about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2022-06-29 15:15:53 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2022-06-29 15:15:53 +0200
commitea97bdc908ce4651cf9167c52817f46a3b4e200e (patch)
tree4cc37e7aeaf2f62559873c17a3d8163293cd19ca
parent27ff258826d560d3c57554153bc9dcfdb6712bc9 (diff)
downloadrust-ea97bdc908ce4651cf9167c52817f46a3b4e200e.tar.gz
rust-ea97bdc908ce4651cf9167c52817f46a3b4e200e.zip
Update/add tests for source sidebar in mobile mode
-rw-r--r--src/test/rustdoc-gui/sidebar-source-code-display.goml10
-rw-r--r--src/test/rustdoc-gui/sidebar-source-code.goml4
2 files changed, 12 insertions, 2 deletions
diff --git a/src/test/rustdoc-gui/sidebar-source-code-display.goml b/src/test/rustdoc-gui/sidebar-source-code-display.goml
index 8f53e8627ee..ea8dde7edeb 100644
--- a/src/test/rustdoc-gui/sidebar-source-code-display.goml
+++ b/src/test/rustdoc-gui/sidebar-source-code-display.goml
@@ -116,3 +116,13 @@ assert-css: (
     "#source-sidebar .expand + .children .folders .name",
     {"color": "rgb(255, 180, 76)", "background-color": "rgb(20, 25, 31)"},
 )
+
+// Now checking on mobile devices.
+size: (500, 700)
+reload:
+// Waiting for the sidebar to be displayed...
+wait-for-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
+
+// We now check it takes the full size of the display.
+assert-property: ("body", {"clientWidth": "500", "clientHeight": "700"})
+assert-property: (".sidebar", {"clientWidth": "500", "clientHeight": "700"})
\ No newline at end of file
diff --git a/src/test/rustdoc-gui/sidebar-source-code.goml b/src/test/rustdoc-gui/sidebar-source-code.goml
index 724520bc399..86df478fa1d 100644
--- a/src/test/rustdoc-gui/sidebar-source-code.goml
+++ b/src/test/rustdoc-gui/sidebar-source-code.goml
@@ -18,8 +18,8 @@ assert: "nav.sidebar"
 
 // We now switch to mobile mode.
 size: (600, 600)
-// We check that the sidebar has the expected width (0 and 1px for the border).
-assert-css: ("nav.sidebar", {"width": "1px"})
+// We check that the sidebar has the expected width (0).
+assert-css: ("nav.sidebar", {"width": "0px"})
 // We expand the sidebar.
 click: "#sidebar-toggle"
 assert-css: (".source-sidebar-expanded nav.sidebar", {"width": "600px"})