fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// This test ensures that the "Auto-hide item methods' documentation" setting is working as 2// expected. 3 4define-function: ( 5 "check-setting", 6 (storage_value, setting_attribute_value, toggle_attribute_value), 7 block { 8 assert-local-storage: {"rustdoc-auto-hide-method-docs": |storage_value|} 9 click: "#settings-menu" 10 wait-for: "#settings" 11 assert-property: ("#auto-hide-method-docs", {"checked": |setting_attribute_value|}) 12 assert-attribute: (".toggle.method-toggle", {"open": |toggle_attribute_value|}) 13 } 14) 15 16go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html" 17 18// We check that the setting is disabled by default. 19call-function: ("check-setting", { 20 "storage_value": null, 21 "setting_attribute_value": "false", 22 "toggle_attribute_value": "", 23}) 24 25// Now we change its value. 26click: "#auto-hide-method-docs" 27assert-local-storage: {"rustdoc-auto-hide-method-docs": "true"} 28 29// We check that the changes were applied as expected. 30reload: 31 32call-function: ("check-setting", { 33 "storage_value": "true", 34 "setting_attribute_value": "true", 35 "toggle_attribute_value": null, 36}) 37 38// And now we re-disable the setting. 39click: "#auto-hide-method-docs" 40assert-local-storage: {"rustdoc-auto-hide-method-docs": "false"} 41 42// And we check everything is back the way it was before. 43reload: 44call-function: ("check-setting", { 45 "storage_value": "false", 46 "setting_attribute_value": "false", 47 "toggle_attribute_value": "", 48})