Skip to content

Commit

Permalink
Rollup merge of rust-lang#106295 - GuillaumeGomez:extend-scraped-exam…
Browse files Browse the repository at this point in the history
…ples-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`
  • Loading branch information
jyn514 authored Dec 30, 2022
2 parents 690f0f7 + 87bc29d commit 14ff27f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/rustdoc-gui/scrape-examples-layout.goml
Original file line number Diff line number Diff line change
Expand Up @@ -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|})

0 comments on commit 14ff27f

Please sign in to comment.