about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-05-18 07:41:00 +0900
committerGitHub <noreply@github.com>2022-05-18 07:41:00 +0900
commitb8dd27079c93d71f9667edbe17d0037c32c299af (patch)
tree284d143011d5442694cb9c120d175e416d967dae /src/test
parent7361b22b4c57a446e042f8cbc95e17969a7301eb (diff)
parent440bbce36d649a973a323ed5fd431e36f124fb59 (diff)
downloadrust-b8dd27079c93d71f9667edbe17d0037c32c299af.tar.gz
rust-b8dd27079c93d71f9667edbe17d0037c32c299af.zip
Rollup merge of #97113 - GuillaumeGomez:search-ui-fixes, r=notriddle
Search GUI fixes

The first fix is about the duplicated "in":

![Screenshot from 2022-05-17 13-25-53](https://user-images.githubusercontent.com/3050060/168814186-a4e9064f-4325-469c-8bf6-46ea2737a24f.png)

The second fix is about the `<select>` broken style:

![Screenshot from 2022-05-17 13-37-03](https://user-images.githubusercontent.com/3050060/168814182-b1c5ae66-d8cf-4fd5-a227-5aa8cd8453ab.png)
![Screenshot from 2022-05-17 13-36-55](https://user-images.githubusercontent.com/3050060/168814184-be9e56f8-fad4-477c-899e-9abff4d4910c.png)

You can test it [here](https://rustdoc.crud.net/imperio/search-ui-fixes/doc/foo/index.html?search=test).

r? `@notriddle`
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-gui/search-filter.goml34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/search-filter.goml b/src/test/rustdoc-gui/search-filter.goml
index aca8390dfb3..d0b3175114c 100644
--- a/src/test/rustdoc-gui/search-filter.goml
+++ b/src/test/rustdoc-gui/search-filter.goml
@@ -45,3 +45,37 @@ goto: file://|DOC_PATH|/test_docs/index.html?search=test&filter-crate=lib2
 wait-for: "#crate-search"
 assert-property: ("#crate-search", {"value": "lib2"})
 assert-false: "#results .externcrate"
+
+// Checking that the text for the "title" is correct (the "All" comes from the "<select>").
+assert-text: ("#search-settings", "Results for test in All", STARTS_WITH)
+
+// Checking the display of the crate filter.
+// We start with the light theme.
+local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
+reload:
+
+timeout: 2000
+wait-for: "#crate-search"
+assert-css: ("#crate-search", {
+    "border": "1px solid rgb(224, 224, 224)",
+    "color": "rgb(0, 0, 0)",
+    "background-color": "rgb(255, 255, 255)",
+})
+
+// We now check the dark theme.
+click: "#settings-menu"
+wait-for: "#settings"
+click: "#theme-dark"
+wait-for-css: ("#crate-search", {
+    "border": "1px solid rgb(240, 240, 240)",
+    "color": "rgb(17, 17, 17)",
+    "background-color": "rgb(240, 240, 240)",
+})
+
+// And finally we check the ayu theme.
+click: "#theme-ayu"
+wait-for-css: ("#crate-search", {
+    "border": "1px solid rgb(66, 76, 87)",
+    "color": "rgb(197, 197, 197)",
+    "background-color": "rgb(20, 25, 32)",
+})