@@ -21,3 +21,31 @@ wait-for-css: ("#settings", {"display": "block"})
2121assert-property: ("#hide-sidebar", {"checked": "true"})
2222click: "#hide-sidebar"
2323wait-for-css: (".sidebar", {"display": "block"})
24+
25+ // Verify that hiding the sidebar hides the source sidebar
26+ // and puts the button in static position mode on mobile
27+ go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
28+ set-window-size: (600, 600)
29+ focus: "#settings-menu a"
30+ press-key: "Enter"
31+ wait-for-css: ("#settings", {"display": "block"})
32+ wait-for-css: ("#sidebar-button", {"position": "fixed"})
33+ store-position: ("#sidebar-button", {
34+ "y": sidebar_button_y,
35+ "x": sidebar_button_x,
36+ })
37+ assert-property: ("#hide-sidebar", {"checked": "false"})
38+ click: "#hide-sidebar"
39+ wait-for-css: (".sidebar", {"display": "none"})
40+ wait-for-css: ("#sidebar-button", {"position": "static"})
41+ assert-position: ("#sidebar-button", {
42+ "y": |sidebar_button_y|,
43+ "x": |sidebar_button_x|,
44+ })
45+ assert-property: ("#hide-sidebar", {"checked": "true"})
46+ press-key: "Escape"
47+ // Clicking the sidebar button should work, and implicitly re-enable
48+ // the persistent navigation bar
49+ wait-for-css: ("#settings", {"display": "none"})
50+ click: "#sidebar-button"
51+ wait-for-css: (".sidebar", {"display": "block"})
0 commit comments