diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/test/rustdoc-gui/anchors.goml | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/rustdoc-gui/anchors.goml')
-rw-r--r-- | src/test/rustdoc-gui/anchors.goml | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/anchors.goml b/src/test/rustdoc-gui/anchors.goml new file mode 100644 index 000000000..84b8bbd1b --- /dev/null +++ b/src/test/rustdoc-gui/anchors.goml @@ -0,0 +1,34 @@ +// This test is to ensure that the anchors (`ยง`) have the expected color and position. +goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html +show-text: true + +// 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: + +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, 55, 138)"}) +assert-css: (".srclink", {"color": "rgb(56, 115, 173)"}) + +move-cursor-to: ".main-heading .srclink" +assert-css: (".srclink", {"text-decoration": "underline solid rgb(56, 115, 173)"}) + +assert-css: ("#top-doc-prose-title", {"color": "rgb(0, 0, 0)"}) + +assert-css: (".sidebar a", {"color": "rgb(53, 109, 164)"}) +assert-css: (".in-band a", {"color": "rgb(0, 0, 0)"}) + +// 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)"}) + +// Same thing with the impl block title. +move-cursor-to: "#impl-HeavilyDocumentedStruct" +assert-css: ("#impl-HeavilyDocumentedStruct a.anchor", {"color": "rgb(0, 0, 0)"}) + +assert-css: ("#title-for-struct-impl-item-doc", {"margin-left": "0px"}) |