@@ -16,15 +16,27 @@ click: (10, 10)
16
16
wait-for: "html:not(.expanded)"
17
17
assert: "nav.sidebar"
18
18
19
+ // Checking that only the path to the current file is "open".
20
+ goto: file://|DOC_PATH|/src/lib2/another_folder/sub_mod/mod.rs.html
21
+ // First we expand the sidebar again.
22
+ click: (10, 10)
23
+ // We wait for the sidebar to be expanded.
24
+ wait-for-css: (".source-sidebar-expanded nav.sidebar", {"width": "300px"})
25
+ assert: "//*[@class='dir-entry' and @open]/*[text()='lib2']"
26
+ assert: "//*[@class='dir-entry' and @open]/*[text()='another_folder']"
27
+ assert: "//*[@class='dir-entry' and @open]/*[text()='sub_mod']"
28
+ // Only "another_folder" should be "open" in "lib2".
29
+ assert: "//*[@class='dir-entry' and not(@open)]/*[text()='another_mod']"
30
+ // All other trees should be collapsed.
31
+ assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@open)]", 5)
32
+
19
33
// We now switch to mobile mode.
20
34
size: (600, 600)
21
- // We check that the sidebar has the expected width (0).
22
- assert-css: ("nav.sidebar", {"width": "0px"})
23
- // We expand the sidebar.
24
- click: "#sidebar-toggle"
25
- assert-css: (".source-sidebar-expanded nav.sidebar", {"width": "600px"})
35
+ wait-for-css: (".source-sidebar-expanded nav.sidebar", {"width": "600px"})
26
36
// We collapse the sidebar.
27
37
click: (10, 10)
38
+ // We check that the sidebar has the expected width (0).
39
+ assert-css: ("nav.sidebar", {"width": "0px"})
28
40
// We ensure that the class has been removed.
29
41
assert-false: ".source-sidebar-expanded"
30
42
assert: "nav.sidebar"
0 commit comments