@@ -3,12 +3,36 @@ goto: file://|DOC_PATH|/test_docs/index.html
33assert-attribute: ("#main-content > details.top-doc", {"open": ""})
44assert-text: ("#toggle-all-docs", "[−]")
55click: "#toggle-all-docs"
6- wait-for: 1000
6+ wait-for: 50
77// This is now collapsed so there shouldn't be the "open" attribute on details.
88assert-attribute-false: ("#main-content > details.top-doc", {"open": ""})
99assert-text: ("#toggle-all-docs", "[+]")
1010click: "#toggle-all-docs"
11- wait-for: 1000
11+ wait-for: 50
1212// Not collapsed anymore so the "open" attribute should be back.
1313assert-attribute: ("#main-content > details.top-doc", {"open": ""})
1414assert-text: ("#toggle-all-docs", "[−]")
15+
16+ // Check that it works on non-module pages as well.
17+ goto: file://|DOC_PATH|/test_docs/struct.Foo.html
18+ // We first check that everything is visible.
19+ assert-text: ("#toggle-all-docs", "[−]")
20+ assert-attribute: ("details.rustdoc-toggle", {"open": ""}, ALL)
21+ // We collapse them all.
22+ click: "#toggle-all-docs"
23+ wait-for: 50
24+ assert-text: ("#toggle-all-docs", "[+]")
25+ // We check that all <details> are collapsed (except for the impl block ones).
26+ assert-attribute-false: ("details.rustdoc-toggle:not(.implementors-toggle)", {"open": ""}, ALL)
27+ assert-attribute: ("details.rustdoc-toggle.implementors-toggle", {"open": ""})
28+ // We now check that the other impl blocks are collapsed.
29+ assert-attribute-false: (
30+ "#blanket-implementations-list > details.rustdoc-toggle.implementors-toggle",
31+ {"open": ""},
32+ ALL,
33+ )
34+ // We open them all again.
35+ click: "#toggle-all-docs"
36+ wait-for: 50
37+ assert-text: ("#toggle-all-docs", "[−]")
38+ assert-attribute: ("details.rustdoc-toggle", {"open": ""}, ALL)
0 commit comments