about summary refs log tree commit diff
path: root/src/test/rustdoc-gui
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-12-30 21:26:35 -0800
committerGitHub <noreply@github.com>2022-12-30 21:26:35 -0800
commit9644684dec97fb5353c1911dc3ca616a76fc977e (patch)
tree2cc937b5f3f0d60f47690ccd1cbe085f3880c7af /src/test/rustdoc-gui
parent81808b7bafb3bf8991046de2bc38d783d92116a8 (diff)
parent87bc29d02b65bd21a49136021d701de42b57390b (diff)
downloadrust-9644684dec97fb5353c1911dc3ca616a76fc977e.tar.gz
rust-9644684dec97fb5353c1911dc3ca616a76fc977e.zip
Rollup merge of #106295 - GuillaumeGomez:extend-scraped-examples-layout-test, r=notriddle
Extend scraped examples layout GUI test for position of buttons

This is a regression test for https://github.com/rust-lang/rust/pull/106279.

r? ````@notriddle````
Diffstat (limited to 'src/test/rustdoc-gui')
-rw-r--r--src/test/rustdoc-gui/scrape-examples-layout.goml14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/scrape-examples-layout.goml b/src/test/rustdoc-gui/scrape-examples-layout.goml
index fde9a0ab0bc..95102528ec1 100644
--- a/src/test/rustdoc-gui/scrape-examples-layout.goml
+++ b/src/test/rustdoc-gui/scrape-examples-layout.goml
@@ -33,3 +33,17 @@ assert-property: (
     ".more-scraped-examples .scraped-example:nth-child(6) .code-wrapper .src-line-numbers",
     {"clientWidth": |clientWidth|}
 )
+
+// Check that for both mobile and desktop sizes, the buttons in scraped examples are displayed
+// correctly.
+
+store-value: (offset_y, 4)
+
+// First with desktop
+assert-position: (".scraped-example .code-wrapper", {"y": 255})
+assert-position: (".scraped-example .code-wrapper .prev", {"y": 255 + |offset_y|})
+
+// Then with mobile
+size: (600, 600)
+assert-position: (".scraped-example .code-wrapper", {"y": 314})
+assert-position: (".scraped-example .code-wrapper .prev", {"y": 314 + |offset_y|})