about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2022-12-30 16:27:56 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2022-12-30 16:27:56 +0100
commit87bc29d02b65bd21a49136021d701de42b57390b (patch)
tree031adddf2546c5c6ec61f3c81f9467fbb100c679
parent5494da23afe9a8ff178475c6bd9d3efb5ddac645 (diff)
downloadrust-87bc29d02b65bd21a49136021d701de42b57390b.tar.gz
rust-87bc29d02b65bd21a49136021d701de42b57390b.zip
Extend scraped examples layout GUI test for position of buttons
-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|})