about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-10-08 21:14:13 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2024-10-09 21:01:08 +0200
commit12d5f0aa2cdd3d53d3d273c360773cd5a1a3c821 (patch)
tree3d9de1467645258f67fa9005fbc860dd60e72cd1
parent16844e24850700386b6a7fc482738400a2f115c9 (diff)
downloadrust-12d5f0aa2cdd3d53d3d273c360773cd5a1a3c821.tar.gz
rust-12d5f0aa2cdd3d53d3d273c360773cd5a1a3c821.zip
Add GUI regression test for methods left margin on mobile
-rw-r--r--tests/rustdoc-gui/methods-left-margin.goml17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/rustdoc-gui/methods-left-margin.goml b/tests/rustdoc-gui/methods-left-margin.goml
new file mode 100644
index 00000000000..af88bbaefc5
--- /dev/null
+++ b/tests/rustdoc-gui/methods-left-margin.goml
@@ -0,0 +1,17 @@
+// This test is to ensure that methods are correctly aligned on the left side.
+
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+
+// First we ensure that we have methods with and without documentation.
+assert: ".impl-items > details.method-toggle > summary > section.method"
+assert: ".impl-items > section.method"
+
+// Checking on desktop.
+set-window-size: (900, 600)
+store-position: (".impl-items section.method", {"x": x})
+assert-position: (".impl-items section.method", {"x": |x|}, ALL)
+
+// Checking on mobile.
+set-window-size: (600, 600)
+store-position: (".impl-items section.method", {"x": x})
+assert-position: (".impl-items section.method", {"x": |x|}, ALL)