about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2021-07-15 22:12:28 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2021-07-15 22:21:33 +0200
commit868ffd03ed2b52d23eeaa9bf48857dde5083c18d (patch)
tree38483b2f8dafa857fefe2aad3a2d40d5408ce9c4 /src/test
parentc3c4b9ead6f12cfcddcd081b47826d59338195fb (diff)
downloadrust-868ffd03ed2b52d23eeaa9bf48857dde5083c18d.tar.gz
rust-868ffd03ed2b52d23eeaa9bf48857dde5083c18d.zip
Add test for sidebar display value on mobile
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-gui/sidebar-mobile.goml10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/sidebar-mobile.goml b/src/test/rustdoc-gui/sidebar-mobile.goml
new file mode 100644
index 00000000000..9a1442e48a9
--- /dev/null
+++ b/src/test/rustdoc-gui/sidebar-mobile.goml
@@ -0,0 +1,10 @@
+// This test ensure that the sidebar isn't "hidden" on mobile but instead moved out of the viewport.
+// This is especially important for devices for "text-first" content (like for users with
+// sight issues).
+goto: file://|DOC_PATH|/test_docs/struct.Foo.html
+// Switching to "mobile view" by reducing the width to 600px.
+size: (600, 600)
+assert-css: (".sidebar-elems", {"display": "block", "left": "-246px"})
+// Opening the sidebar menu.
+click: ".sidebar-menu"
+assert-css: (".sidebar-elems", {"display": "block", "left": "0px"})