granite-rust/src/test/rustdoc-gui/anchors.goml

31 lines
1.2 KiB
Text
Raw Normal View History

2021-11-24 13:35:25 +01:00
// This test is to ensure that the anchors (`§`) have the expected color.
goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
2021-11-24 18:01:34 +01:00
show-text: true
2021-11-24 13:35:25 +01:00
// This is needed to ensure that the text color is computed.
show-text: true
// Set the theme to light.
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
// We reload the page so the local storage settings are being used.
reload:
2021-11-24 13:35:25 +01:00
assert-css: ("#toggle-all-docs", {"color": "rgb(0, 0, 0)"})
assert-css: (".fqn .in-band a:nth-of-type(1)", {"color": "rgb(0, 0, 0)"})
assert-css: (".fqn .in-band a:nth-of-type(2)", {"color": "rgb(173, 68, 142)"})
assert-css: (".srclink", {"color": "rgb(0, 0, 0)"})
assert-css: (".srclink", {"color": "rgb(0, 0, 0)"})
assert-css: ("#top-doc-prose-title", {"color": "rgb(0, 0, 0)"})
assert-css: (".sidebar a", {"color": "rgb(0, 0, 0)"})
assert-css: (".in-band a", {"color": "rgb(0, 0, 0)"})
2021-11-24 13:35:25 +01:00
// We move the cursor over the "Implementations" title so the anchor is displayed.
move-cursor-to: "h2#implementations"
assert-css: ("h2#implementations a.anchor", {"color": "rgb(0, 0, 0)"})
2021-11-24 13:35:25 +01:00
// Same thing with the impl block title.
move-cursor-to: "#impl"
assert-css: ("#impl a.anchor", {"color": "rgb(0, 0, 0)"})