From 6e2c49f7eddb4c09e17653760965b69a3dc97fb0 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sat, 2 Jul 2022 10:41:46 -0700 Subject: [PATCH] rustdoc: add gui test case ensuring source sidebar doesn't spontaneously open --- src/test/rustdoc-gui/sidebar-source-code-display.goml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/test/rustdoc-gui/sidebar-source-code-display.goml b/src/test/rustdoc-gui/sidebar-source-code-display.goml index 7728bfd025ff2..8d13246a63f80 100644 --- a/src/test/rustdoc-gui/sidebar-source-code-display.goml +++ b/src/test/rustdoc-gui/sidebar-source-code-display.goml @@ -26,6 +26,7 @@ wait-for-css: (".sidebar", {"width": "300px"}) assert-local-storage: {"rustdoc-source-sidebar-show": "true"} click: ".sidebar a.selected" goto: file://|DOC_PATH|/src/test_docs/lib.rs.html +wait-for-css: (".sidebar", {"width": "300px"}) assert-local-storage: {"rustdoc-source-sidebar-show": "true"} // Now we check the display of the sidebar items. @@ -169,8 +170,16 @@ assert-window-property: {"pageYOffset": "2519"} // you click one of them, you probably want to actually see the file's contents, and not just // make it the current selection. click: "#sidebar-toggle" -wait-for-css: (".sidebar", {"width": "500px"}) +wait-for-css: ("#source-sidebar", {"visibility": "visible"}) assert-local-storage: {"rustdoc-source-sidebar-show": "true"} click: ".sidebar a.selected" goto: file://|DOC_PATH|/src/test_docs/lib.rs.html +wait-for-css: ("#source-sidebar", {"visibility": "hidden"}) +assert-local-storage: {"rustdoc-source-sidebar-show": "false"} +// Resize back to desktop size, to check that the sidebar doesn't spontaneously open. +size: (1000, 1000) +wait-for-css: ("#source-sidebar", {"visibility": "hidden"}) assert-local-storage: {"rustdoc-source-sidebar-show": "false"} +click: "#sidebar-toggle" +wait-for-css: ("#source-sidebar", {"visibility": "visible"}) +assert-local-storage: {"rustdoc-source-sidebar-show": "true"}