]> git.proxmox.com Git - rustc.git/blobdiff - src/test/rustdoc-gui/search-filter.goml
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / rustdoc-gui / search-filter.goml
index aca8390dfb3d5d914605fc3182fbd6f26babfd90..d0b3175114cce90897c05097cdf11b0247062f35 100644 (file)
@@ -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)",
+})