fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.2 KiB76 linesraw
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.
3go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
4
5// Desktop view
6set-window-size: (1080, 600)
7assert: (".stab.deprecated")
8assert: (".stab.portability")
9
10// make sure that deprecated and portability have the right colors
11assert-css: (
12    ".item-table .item-name .stab.deprecated",
13    { "background-color": "#fff5d6" },
14)
15assert-css: (
16    ".item-table .item-name .stab.portability",
17    { "background-color": "#fff5d6" },
18)
19
20// table like view
21assert-css: (".desc.docblock-short", { "padding-left": "0px" })
22compare-elements-position-near: (
23    "//*[@class='item-name']//a[text()='replaced_function']",
24    ".item-name .stab.deprecated",
25    {"y": 2},
26)
27compare-elements-position: (
28    ".item-name .stab.deprecated",
29    ".item-name .stab.portability",
30    ("y"),
31)
32
33// Ensure no wrap
34compare-elements-position: (
35    "//*[@class='item-name']//a[text()='replaced_function']/..",
36    "//*[@class='desc docblock-short'][text()='a thing with a label']",
37    ("y"),
38)
39
40// Mobile view
41set-window-size: (600, 600)
42// staggered layout with 2em spacing
43assert-css: (".desc.docblock-short", { "padding-left": "32px" })
44compare-elements-position-near: (
45    "//*[@class='item-name']//a[text()='replaced_function']",
46    ".item-name .stab.deprecated",
47    {"y": 2},
48)
49compare-elements-position: (
50    ".item-name .stab.deprecated",
51    ".item-name .stab.portability",
52    ("y"),
53)
54
55// Ensure wrap
56compare-elements-position-false: (
57    "//*[@class='item-name']//a[text()='replaced_function']/..",
58    "//*[@class='desc docblock-short'][text()='a thing with a label']",
59    ("y"),
60)
61compare-elements-position-false: (
62    ".item-name .stab.deprecated",
63    "//*[@class='desc docblock-short'][text()='a thing with a label']",
64    ("y"),
65)
66
67// Ensure it doesn't expand.
68set-window-size: (800, 800)
69go-to: "file://" + |DOC_PATH| + "/test_docs/cfgs/index.html"
70// This part of the tags should not be on the same line as the beginning since the width
71// is too small for that.
72compare-elements-position-false: (
73    "//*[@class='stab portability']/code[text()='appservice-api-c']",
74    "//*[@class='stab portability']/code[text()='server']",
75    ("y"),
76)