Skip to content

Commit 6e2c49f

Browse files
committed
rustdoc: add gui test case ensuring source sidebar doesn't spontaneously open
1 parent 83f2288 commit 6e2c49f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: src/test/rustdoc-gui/sidebar-source-code-display.goml

+10-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ wait-for-css: (".sidebar", {"width": "300px"})
2626
assert-local-storage: {"rustdoc-source-sidebar-show": "true"}
2727
click: ".sidebar a.selected"
2828
goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
29+
wait-for-css: (".sidebar", {"width": "300px"})
2930
assert-local-storage: {"rustdoc-source-sidebar-show": "true"}
3031

3132
// Now we check the display of the sidebar items.
@@ -169,8 +170,16 @@ assert-window-property: {"pageYOffset": "2519"}
169170
// you click one of them, you probably want to actually see the file's contents, and not just
170171
// make it the current selection.
171172
click: "#sidebar-toggle"
172-
wait-for-css: (".sidebar", {"width": "500px"})
173+
wait-for-css: ("#source-sidebar", {"visibility": "visible"})
173174
assert-local-storage: {"rustdoc-source-sidebar-show": "true"}
174175
click: ".sidebar a.selected"
175176
goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
177+
wait-for-css: ("#source-sidebar", {"visibility": "hidden"})
178+
assert-local-storage: {"rustdoc-source-sidebar-show": "false"}
179+
// Resize back to desktop size, to check that the sidebar doesn't spontaneously open.
180+
size: (1000, 1000)
181+
wait-for-css: ("#source-sidebar", {"visibility": "hidden"})
176182
assert-local-storage: {"rustdoc-source-sidebar-show": "false"}
183+
click: "#sidebar-toggle"
184+
wait-for-css: ("#source-sidebar", {"visibility": "visible"})
185+
assert-local-storage: {"rustdoc-source-sidebar-show": "true"}

0 commit comments

Comments
 (0)