about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2023-04-22 16:00:29 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2023-06-02 23:56:10 +0200
commit7a09a688de6f1565fe1608eaaaee5ff4fe0c3a6d (patch)
tree91759d0b477091018211ddb187ed0a1fa22d22e3
parent741d210c44bc637a30dd1e4675848c1c2aae5952 (diff)
downloadrust-7a09a688de6f1565fe1608eaaaee5ff4fe0c3a6d.tar.gz
rust-7a09a688de6f1565fe1608eaaaee5ff4fe0c3a6d.zip
Update rustdoc tests and add more checks for type kind colors
-rw-r--r--tests/rustdoc-gui/search-reexport.goml2
-rw-r--r--tests/rustdoc-gui/search-result-color.goml14
-rw-r--r--tests/rustdoc-gui/search-result-keyword.goml4
3 files changed, 14 insertions, 6 deletions
diff --git a/tests/rustdoc-gui/search-reexport.goml b/tests/rustdoc-gui/search-reexport.goml
index fd817b58990..06a0dc949c4 100644
--- a/tests/rustdoc-gui/search-reexport.goml
+++ b/tests/rustdoc-gui/search-reexport.goml
@@ -14,7 +14,7 @@ assert-attribute: (
     "//a[@class='result-import']",
     {"href": "../test_docs/index.html#reexport.TheStdReexport"},
 )
-assert-text: ("//a[@class='result-import']", "test_docs::TheStdReexport")
+assert-text: ("//a[@class='result-import']", "test_docs::TheStdReexport (re-export)")
 click: "//a[@class='result-import']"
 // We check that it has the background modified thanks to the focus.
 wait-for-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "rgb(73, 74, 61)"})
diff --git a/tests/rustdoc-gui/search-result-color.goml b/tests/rustdoc-gui/search-result-color.goml
index 90f7160b724..b0d236ce1e5 100644
--- a/tests/rustdoc-gui/search-result-color.goml
+++ b/tests/rustdoc-gui/search-result-color.goml
@@ -5,6 +5,7 @@ define-function: (
     (result_kind, color, hover_color),
     block {
         assert-css: (".result-" + |result_kind| + " ." + |result_kind|, {"color": |color|}, ALL)
+        assert-css: (".result-" + |result_kind| + " i", {"color": |default_color|})
         assert-css: (
             ".result-" + |result_kind|,
             {"color": |entry_color|, "background-color": |background_color|},
@@ -18,6 +19,7 @@ define-function: (
             ".result-" + |result_kind| + ":hover ." + |result_kind|,
             {"color": |hover_color|},
         )
+        assert-css: (".result-" + |result_kind| + ":hover i", {"color": |default_color|})
         move-cursor-to: ".search-input"
         focus: ".result-" + |result_kind|
         assert-css: (
@@ -65,10 +67,12 @@ assert-css: (
     {"border-bottom-color": "#aaa3"}
 )
 
+store-value: (default_color, "rgb(197, 197, 197)")
+
 // Checking the color of "keyword" text.
 assert-css: (
     "//*[@class='result-name']//*[text()='(keyword)']",
-    {"color": "#788797"},
+    {"color": |default_color|},
 )
 
 store-value: (entry_color, "#0096cf") // color of the search entry
@@ -182,10 +186,12 @@ assert-css: (
     {"border-bottom-color": "#aaa3"}
 )
 
+store-value: (default_color, "rgb(221, 221, 221)")
+
 // Checking the color for "keyword" text.
 assert-css: (
     "//*[@class='result-name']//*[text()='(keyword)']",
-    {"color": "#ddd"},
+    {"color": |default_color|},
 )
 
 store-value: (entry_color, "#ddd") // color of the search entry
@@ -284,10 +290,12 @@ assert-css: (
     {"border-bottom-color": "#aaa3"}
 )
 
+store-value: (default_color, "rgb(0, 0, 0)")
+
 // Checking the color for "keyword" text.
 assert-css: (
     "//*[@class='result-name']//*[text()='(keyword)']",
-    {"color": "#000"},
+    {"color": |default_color|},
 )
 
 store-value: (entry_color, "#000") // color of the search entry
diff --git a/tests/rustdoc-gui/search-result-keyword.goml b/tests/rustdoc-gui/search-result-keyword.goml
index 5d56e9d9cd4..8d6478e28a5 100644
--- a/tests/rustdoc-gui/search-result-keyword.goml
+++ b/tests/rustdoc-gui/search-result-keyword.goml
@@ -9,5 +9,5 @@ wait-for: "#search-tabs"
 // less good.
 //
 // Checking that the CSS is displaying " (keyword)" in italic.
-assert-text: (".result-name span.keyword > i", "(keyword)")
-assert-text: (".result-name span.keyword", "CookieMonster (keyword)")
+assert-text: (".result-keyword span.keyword + i", "(keyword)")
+assert-text: (".result-keyword .result-name", "CookieMonster (keyword)")