fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.6 KiB51 linesraw
1// This test ensures that the "Auto-hide item contents for large items" setting is working as
2// expected.
3
4// We need to disable this check because `implementors/test_docs/trait.Iterator.js` doesn't exist.
5fail-on-request-error: false
6
7define-function: (
8    "check-setting",
9    (storage_value, setting_attribute_value, toggle_attribute_value),
10    block {
11        assert-local-storage: {"rustdoc-auto-hide-large-items": |storage_value|}
12        click: "#settings-menu"
13        wait-for: "#settings"
14        assert-property: ("#auto-hide-large-items", {"checked": |setting_attribute_value|})
15        assert-attribute: (".item-decl .type-contents-toggle", {"open": |toggle_attribute_value|})
16    }
17)
18
19go-to: "file://" + |DOC_PATH| + "/lib2/scroll_traits/trait.Iterator.html"
20
21// We check that the setting is enabled by default and is working.
22call-function: ("check-setting", {
23    "storage_value": null,
24    "setting_attribute_value": "true",
25    "toggle_attribute_value": null,
26})
27
28// Now we change its value.
29click: "#auto-hide-large-items"
30assert-local-storage: {"rustdoc-auto-hide-large-items": "false"}
31
32// We check that the changes were applied as expected.
33reload:
34
35call-function: ("check-setting", {
36    "storage_value": "false",
37    "setting_attribute_value": "false",
38    "toggle_attribute_value": "",
39})
40
41// And now we re-enable the setting.
42click: "#auto-hide-large-items"
43assert-local-storage: {"rustdoc-auto-hide-large-items": "true"}
44
45// And we check everything is back the way it was before.
46reload:
47call-function: ("check-setting", {
48    "storage_value": "true",
49    "setting_attribute_value": "true",
50    "toggle_attribute_value": null,
51})