summaryrefslogtreecommitdiffstats
path: root/src/test/rustdoc-gui/label-next-to-symbol.goml
blob: 05f8ddc716e8703b6bcadd675c04b83dbd6fc568 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// These tests verify that labels like "UNIX" and "Deprecated" stay on the same line as their symbol.
// It also verifies the staggered layout on mobile.
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"

// Desktop view
size: (1080, 600)
assert: (".stab.deprecated")
assert: (".stab.portability")

// make sure that deprecated and portability have the right colors
assert-css: (
    ".item-table .item-left .stab.deprecated",
    { "background-color": "rgb(255, 245, 214)" },
)
assert-css: (
    ".item-table .item-left .stab.portability",
    { "background-color": "rgb(255, 245, 214)" },
)

// table like view
assert-css: (".item-right.docblock-short", { "padding-left": "0px" })
compare-elements-position-near: (
    "//*[@class='item-left module-item']//a[text()='replaced_function']",
    ".item-left .stab.deprecated",
    {"y": 2},
)
compare-elements-position: (
    ".item-left .stab.deprecated",
    ".item-left .stab.portability",
    ("y"),
)

// Ensure no wrap
compare-elements-position: (
    "//*[@class='item-left module-item']//a[text()='replaced_function']/..",
    "//*[@class='item-right docblock-short'][text()='a thing with a label']",
    ("y"),
)


// Mobile view
size: (600, 600)
// staggered layout with 2em spacing
assert-css: (".item-right.docblock-short", { "padding-left": "32px" })
compare-elements-position-near: (
    "//*[@class='item-left module-item']//a[text()='replaced_function']",
    ".item-left .stab.deprecated",
    {"y": 2},
)
compare-elements-position: (
    ".item-left .stab.deprecated",
    ".item-left .stab.portability",
    ("y"),
)

// Ensure wrap
compare-elements-position-false: (
    "//*[@class='item-left module-item']//a[text()='replaced_function']/..",
    "//*[@class='item-right docblock-short'][text()='a thing with a label']",
    ("y"),
)
compare-elements-position-false: (
    ".item-left .stab.deprecated",
    "//*[@class='item-right docblock-short'][text()='a thing with a label']",
    ("y"),
)