]> git.proxmox.com Git - rustc.git/blame - src/test/rustdoc-gui/label-next-to-symbol.goml
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / rustdoc-gui / label-next-to-symbol.goml
CommitLineData
136023e0
XL
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.
3goto: file://|DOC_PATH|/test_docs/index.html
4
5// Desktop view
6size: (1080, 600)
7assert: (".stab.deprecated")
8assert: (".stab.portability")
9
10// make sure that deprecated and portability are different colours
11assert-css: (".item-table .item-left .stab.deprecated", { "background-color": "rgb(255, 196, 196)" })
12assert-css: (".item-table .item-left .stab.portability", { "background-color": "rgb(243, 223, 255)" })
13
14// table like view
15assert-css: (".item-right.docblock-short", { "padding-left": "0px" })
16compare-elements-position-near: ("//*[@class='item-left module-item']//a[text()='replaced_function']", ".item-left .stab.deprecated", {"y": 2})
17compare-elements-position: (".item-left .stab.deprecated", ".item-left .stab.portability", ("y"))
18
19// Ensure no wrap
20compare-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
22compare-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
26size: (600, 600)
27// staggered layout with 2em spacing
28assert-css: (".item-right.docblock-short", { "padding-left": "32px" })
29compare-elements-position-near: ("//*[@class='item-left module-item']//a[text()='replaced_function']", ".item-left .stab.deprecated", {"y": 1})
30compare-elements-position: (".item-left .stab.deprecated", ".item-left .stab.portability", ("y"))
31
32// Ensure wrap
33compare-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
35compare-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"))
36compare-elements-position-false: (".item-left .stab.deprecated", "//*[@class='item-right docblock-short']//p[text()='a thing with a label']", ("y"))