Skip to content

Commit 14ff27f

Browse files
authored
Rollup merge of rust-lang#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 rust-lang#106279. r? `@notriddle`
2 parents 690f0f7 + 87bc29d commit 14ff27f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/test/rustdoc-gui/scrape-examples-layout.goml

+14
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,17 @@ assert-property: (
3333
".more-scraped-examples .scraped-example:nth-child(6) .code-wrapper .src-line-numbers",
3434
{"clientWidth": |clientWidth|}
3535
)
36+
37+
// Check that for both mobile and desktop sizes, the buttons in scraped examples are displayed
38+
// correctly.
39+
40+
store-value: (offset_y, 4)
41+
42+
// First with desktop
43+
assert-position: (".scraped-example .code-wrapper", {"y": 255})
44+
assert-position: (".scraped-example .code-wrapper .prev", {"y": 255 + |offset_y|})
45+
46+
// Then with mobile
47+
size: (600, 600)
48+
assert-position: (".scraped-example .code-wrapper", {"y": 314})
49+
assert-position: (".scraped-example .code-wrapper .prev", {"y": 314 + |offset_y|})

0 commit comments

Comments
 (0)