rust/tests/rustdoc-gui/label-next-to-symbol.goml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

77 lines
2.3 KiB
Plaintext
Raw Normal View History

// 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.
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// Desktop view
set-window-size: (1080, 600)
assert: (".stab.deprecated")
assert: (".stab.portability")
// make sure that deprecated and portability have the right colors
assert-css: (
".item-table .item-name .stab.deprecated",
{ "background-color": "#fff5d6" },
)
assert-css: (
".item-table .item-name .stab.portability",
{ "background-color": "#fff5d6" },
)
// table like view
assert-css: (".desc.docblock-short", { "padding-left": "0px" })
compare-elements-position-near: (
"//*[@class='item-name']//a[text()='replaced_function']",
".item-name .stab.deprecated",
{"y": 2},
)
compare-elements-position: (
".item-name .stab.deprecated",
".item-name .stab.portability",
2024-04-01 14:11:22 -05:00
["y"],
)
// Ensure no wrap
compare-elements-position: (
"//*[@class='item-name']//a[text()='replaced_function']/..",
"//*[@class='desc docblock-short'][text()='a thing with a label']",
2024-04-01 14:11:22 -05:00
["y"],
)
// Mobile view
set-window-size: (600, 600)
// staggered layout with 2em spacing
assert-css: (".desc.docblock-short", { "padding-left": "32px" })
compare-elements-position-near: (
"//*[@class='item-name']//a[text()='replaced_function']",
".item-name .stab.deprecated",
{"y": 2},
)
compare-elements-position: (
".item-name .stab.deprecated",
".item-name .stab.portability",
2024-04-01 14:11:22 -05:00
["y"],
)
// Ensure wrap
compare-elements-position-false: (
"//*[@class='item-name']//a[text()='replaced_function']/..",
"//*[@class='desc docblock-short'][text()='a thing with a label']",
2024-04-01 14:11:22 -05:00
["y"],
)
compare-elements-position-false: (
".item-name .stab.deprecated",
"//*[@class='desc docblock-short'][text()='a thing with a label']",
2024-04-01 14:11:22 -05:00
["y"],
)
// Ensure it doesn't expand.
set-window-size: (800, 800)
go-to: "file://" + |DOC_PATH| + "/test_docs/cfgs/index.html"
// This part of the tags should not be on the same line as the beginning since the width
// is too small for that.
compare-elements-position-false: (
"//*[@class='stab portability']/code[text()='appservice-api-c']",
"//*[@class='stab portability']/code[text()='server']",
2024-04-01 14:11:22 -05:00
["y"],
)