]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-gui/label-next-to-symbol.goml
Rollup merge of #104252 - faern:stabilize-const_socketaddr, r=JohnTitor
[rust.git] / tests / 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 have the right colors
11 assert-css: (
12     ".item-table .item-left .stab.deprecated",
13     { "background-color": "rgb(255, 245, 214)" },
14 )
15 assert-css: (
16     ".item-table .item-left .stab.portability",
17     { "background-color": "rgb(255, 245, 214)" },
18 )
19
20 // table like view
21 assert-css: (".item-right.docblock-short", { "padding-left": "0px" })
22 compare-elements-position-near: (
23     "//*[@class='item-left']//a[text()='replaced_function']",
24     ".item-left .stab.deprecated",
25     {"y": 2},
26 )
27 compare-elements-position: (
28     ".item-left .stab.deprecated",
29     ".item-left .stab.portability",
30     ("y"),
31 )
32
33 // Ensure no wrap
34 compare-elements-position: (
35     "//*[@class='item-left']//a[text()='replaced_function']/..",
36     "//*[@class='item-right docblock-short'][text()='a thing with a label']",
37     ("y"),
38 )
39
40
41 // Mobile view
42 size: (600, 600)
43 // staggered layout with 2em spacing
44 assert-css: (".item-right.docblock-short", { "padding-left": "32px" })
45 compare-elements-position-near: (
46     "//*[@class='item-left']//a[text()='replaced_function']",
47     ".item-left .stab.deprecated",
48     {"y": 2},
49 )
50 compare-elements-position: (
51     ".item-left .stab.deprecated",
52     ".item-left .stab.portability",
53     ("y"),
54 )
55
56 // Ensure wrap
57 compare-elements-position-false: (
58     "//*[@class='item-left']//a[text()='replaced_function']/..",
59     "//*[@class='item-right docblock-short'][text()='a thing with a label']",
60     ("y"),
61 )
62 compare-elements-position-false: (
63     ".item-left .stab.deprecated",
64     "//*[@class='item-right docblock-short'][text()='a thing with a label']",
65     ("y"),
66 )