about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2024-12-31 18:42:23 -0500
committerGitHub <noreply@github.com>2024-12-31 18:42:23 -0500
commit63d5b724823d3007ce7ae299124c6e158c7e201b (patch)
tree432ec8bf63916cf97610bf876697054984d6c45c
parent3d3d898a2edbaa08c30c1c80830b1ab2e3c9e7a6 (diff)
parent00bf8717e3ab5273b3ec587e3a241408cca23935 (diff)
downloadrust-63d5b724823d3007ce7ae299124c6e158c7e201b.tar.gz
rust-63d5b724823d3007ce7ae299124c6e158c7e201b.zip
Rollup merge of #134861 - GuillaumeGomez:item-info-colors, r=fmease
Add GUI test for item info elements color

Fixes https://github.com/rust-lang/rust/issues/98341.

r? ``@fmease``
-rw-r--r--tests/rustdoc-gui/item-info.goml23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/rustdoc-gui/item-info.goml b/tests/rustdoc-gui/item-info.goml
index b5b0052fe61..647a2fd290d 100644
--- a/tests/rustdoc-gui/item-info.goml
+++ b/tests/rustdoc-gui/item-info.goml
@@ -45,3 +45,26 @@ compare-elements-css: (
     "#main-content > .item-info .stab:nth-of-type(2)",
     ["height"],
 )
+
+// Now checking the text color and the links color.
+show-text: true
+include: "utils.goml"
+go-to: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html"
+
+call-function: ("switch-theme", {"theme": "ayu"})
+assert-css: (".item-info .stab", {"color": "rgb(197, 197, 197)"}, ALL)
+assert-css: (".item-info .stab strong", {"color": "rgb(197, 197, 197)"}, ALL)
+assert-css: (".item-info .stab span", {"color": "rgb(197, 197, 197)"}, ALL)
+assert-css: (".item-info .stab a", {"color": "rgb(57, 175, 215)"}, ALL)
+
+call-function: ("switch-theme", {"theme": "dark"})
+assert-css: (".item-info .stab", {"color": "rgb(221, 221, 221)"}, ALL)
+assert-css: (".item-info .stab strong", {"color": "rgb(221, 221, 221)"}, ALL)
+assert-css: (".item-info .stab span", {"color": "rgb(221, 221, 221)"}, ALL)
+assert-css: (".item-info .stab a", {"color": "rgb(210, 153, 29)"}, ALL)
+
+call-function: ("switch-theme", {"theme": "light"})
+assert-css: (".item-info .stab", {"color": "rgb(0, 0, 0)"}, ALL)
+assert-css: (".item-info .stab strong", {"color": "rgb(0, 0, 0)"}, ALL)
+assert-css: (".item-info .stab span", {"color": "rgb(0, 0, 0)"}, ALL)
+assert-css: (".item-info .stab a", {"color": "rgb(56, 115, 173)"}, ALL)