@@ -3,12 +3,36 @@ goto: file://|DOC_PATH|/test_docs/index.html
3
3
assert-attribute: ("#main-content > details.top-doc", {"open": ""})
4
4
assert-text: ("#toggle-all-docs", "[−]")
5
5
click: "#toggle-all-docs"
6
- wait-for: 1000
6
+ wait-for: 50
7
7
// This is now collapsed so there shouldn't be the "open" attribute on details.
8
8
assert-attribute-false: ("#main-content > details.top-doc", {"open": ""})
9
9
assert-text: ("#toggle-all-docs", "[+]")
10
10
click: "#toggle-all-docs"
11
- wait-for: 1000
11
+ wait-for: 50
12
12
// Not collapsed anymore so the "open" attribute should be back.
13
13
assert-attribute: ("#main-content > details.top-doc", {"open": ""})
14
14
assert-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