]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/label-next-to-symbol.goml
Rollup merge of #91172 - Ethiraric:ethiraric/fix90979, r=petrochenkov
[rust.git] / src / test / rustdoc-gui / label-next-to-symbol.goml
1 // These tests verify that labels like "UNIX" and "Deprecated" stay on the same line as their symbol.
2 // It also verifies the staggered layout on mobile.
3 goto: file://|DOC_PATH|/test_docs/index.html
4
5 // Desktop view
6 size: (1080, 600)
7 assert: (".stab.deprecated")
8 assert: (".stab.portability")
9
10 // make sure that deprecated and portability are different colours
11 assert-css: (".item-table .item-left .stab.deprecated", { "background-color": "rgb(255, 196, 196)" })
12 assert-css: (".item-table .item-left .stab.portability", { "background-color": "rgb(243, 223, 255)" })
13
14 // table like view
15 assert-css: (".item-right.docblock-short", { "padding-left": "0px" })
16 compare-elements-position-near: ("//*[@class='item-left module-item']//a[text()='replaced_function']", ".item-left .stab.deprecated", {"y": 2})
17 compare-elements-position: (".item-left .stab.deprecated", ".item-left .stab.portability", ("y"))
18
19 // Ensure no wrap
20 compare-elements-position-near: ("//*[@class='item-left module-item']//a[text()='replaced_function']", "//*[@class='item-right docblock-short']//p[text()='a thing with a label']", {"y": 2})
21 // compare parent elements
22 compare-elements-position: ("//*[@class='item-left module-item']//a[text()='replaced_function']/..", "//*[@class='item-right docblock-short']//p[text()='a thing with a label']/..", ("y"))
23
24
25 // Mobile view
26 size: (600, 600)
27 // staggered layout with 2em spacing
28 assert-css: (".item-right.docblock-short", { "padding-left": "32px" })
29 compare-elements-position-near: ("//*[@class='item-left module-item']//a[text()='replaced_function']", ".item-left .stab.deprecated", {"y": 1})
30 compare-elements-position: (".item-left .stab.deprecated", ".item-left .stab.portability", ("y"))
31
32 // Ensure wrap
33 compare-elements-position-near-false: ("//*[@class='item-left module-item']//a[text()='replaced_function']", "//*[@class='item-right docblock-short']//p[text()='a thing with a label']", {"y": 12})
34 // compare parent elements
35 compare-elements-position-false: ("//*[@class='item-left module-item']//a[text()='replaced_function']/..", "//*[@class='item-right docblock-short']//p[text()='a thing with a label']/..", ("y"))
36 compare-elements-position-false: (".item-left .stab.deprecated", "//*[@class='item-right docblock-short']//p[text()='a thing with a label']", ("y"))