about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2022-11-12 17:25:02 +0100
committerGitHub <noreply@github.com>2022-11-12 17:25:02 +0100
commit6601e2014881ce7bcd156851ed56457029eafe8f (patch)
treeebba9459d706ade40f5e318ed1eae55e59352aef /src/test
parent55ae6516f9bed7a1cd65b784c56919133486f546 (diff)
parentee7381266a40276c7697a2f6bedc0bb9f8debd4b (diff)
downloadrust-6601e2014881ce7bcd156851ed56457029eafe8f.tar.gz
rust-6601e2014881ce7bcd156851ed56457029eafe8f.zip
Rollup merge of #104250 - GuillaumeGomez:migrate-not-found-link-color, r=notriddle
Migrate no result page link color to CSS variables

r? ``@notriddle``
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-gui/search-no-result.goml36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/search-no-result.goml b/src/test/rustdoc-gui/search-no-result.goml
new file mode 100644
index 00000000000..b88be32c94a
--- /dev/null
+++ b/src/test/rustdoc-gui/search-no-result.goml
@@ -0,0 +1,36 @@
+// The goal of this test is to check the color of the "no result" links.
+goto: "file://" + |DOC_PATH| + "/lib2/index.html?search=sdkfskjfsdks"
+show-text: true
+
+define-function: (
+    "check-no-result",
+    (theme, link, link_hover),
+    [
+        // Changing theme.
+        ("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
+        ("reload"),
+        ("wait-for", "#results"),
+        ("assert", ".search-failed.active"),
+        ("assert-css", ("#results a", {"color": |link|}, ALL)),
+        ("move-cursor-to", "#results a"),
+        ("assert-css", ("#results a:hover", {"color": |link_hover|})),
+        // Moving the cursor to some other place to not create issues with next function run.
+        ("move-cursor-to", ".search-input"),
+    ]
+)
+
+call-function: ("check-no-result", {
+    "theme": "ayu",
+    "link": "rgb(57, 175, 215)",
+    "link_hover": "rgb(57, 175, 215)",
+})
+call-function: ("check-no-result", {
+    "theme": "dark",
+    "link": "rgb(210, 153, 29)",
+    "link_hover": "rgb(210, 153, 29)",
+})
+call-function: ("check-no-result", {
+    "theme": "light",
+    "link": "rgb(56, 115, 173)",
+    "link_hover": "rgb(56, 115, 173)",
+})