]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-gui/scrape-examples-layout.goml
Rollup merge of #107524 - cjgillot:both-storage, r=RalfJung
[rust.git] / tests / rustdoc-gui / scrape-examples-layout.goml
1 // Check that the line number column has the correct layout.
2 goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
3
4 // Check that it's not zero.
5 assert-property-false: (
6     ".more-scraped-examples .scraped-example .code-wrapper .src-line-numbers",
7     {"clientWidth": "0"}
8 )
9
10 // Check that examples with very long lines have the same width as ones that don't.
11 store-property: (
12     clientWidth,
13     ".more-scraped-examples .scraped-example:nth-child(2) .code-wrapper .src-line-numbers",
14     "clientWidth"
15 )
16
17 assert-property: (
18     ".more-scraped-examples .scraped-example:nth-child(3) .code-wrapper .src-line-numbers",
19     {"clientWidth": |clientWidth|}
20 )
21
22 assert-property: (
23     ".more-scraped-examples .scraped-example:nth-child(4) .code-wrapper .src-line-numbers",
24     {"clientWidth": |clientWidth|}
25 )
26
27 assert-property: (
28     ".more-scraped-examples .scraped-example:nth-child(5) .code-wrapper .src-line-numbers",
29     {"clientWidth": |clientWidth|}
30 )
31
32 assert-property: (
33     ".more-scraped-examples .scraped-example:nth-child(6) .code-wrapper .src-line-numbers",
34     {"clientWidth": |clientWidth|}
35 )
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|})