@@ -16,15 +16,27 @@ click: (10, 10)
1616wait-for: "html:not(.expanded)"
1717assert: "nav.sidebar"
1818
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+
1933// We now switch to mobile mode.
2034size: (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"})
2636// We collapse the sidebar.
2737click: (10, 10)
38+ // We check that the sidebar has the expected width (0).
39+ assert-css: ("nav.sidebar", {"width": "0px"})
2840// We ensure that the class has been removed.
2941assert-false: ".source-sidebar-expanded"
3042assert: "nav.sidebar"
0 commit comments