rust/tests/rustdoc-gui/label-next-to-symbol.goml
Michael Howell 894c98652c rustdoc: simplify DOM for .item-table
This switches from using `<div>` to the more semantic `<ul>`, and
using class names that rhyme with the classes the search results
table uses.
2023-02-07 19:00:42 -07:00

67 lines
1.8 KiB
Plaintext

// 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-name .stab.deprecated",
{ "background-color": "rgb(255, 245, 214)" },
)
assert-css: (
".item-table .item-name .stab.portability",
{ "background-color": "rgb(255, 245, 214)" },
)
// 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",
("y"),
)
// Ensure no wrap
compare-elements-position: (
"//*[@class='item-name']//a[text()='replaced_function']/..",
"//*[@class='desc docblock-short'][text()='a thing with a label']",
("y"),
)
// Mobile view
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",
("y"),
)
// Ensure wrap
compare-elements-position-false: (
"//*[@class='item-name']//a[text()='replaced_function']/..",
"//*[@class='desc docblock-short'][text()='a thing with a label']",
("y"),
)
compare-elements-position-false: (
".item-name .stab.deprecated",
"//*[@class='desc docblock-short'][text()='a thing with a label']",
("y"),
)