Skip to content

Commit 440bbce

Browse files
Add GUI test for search crate filter select CSS properties
1 parent 0f8b3f4 commit 440bbce

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/test/rustdoc-gui/search-filter.goml

+31
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,34 @@ assert-false: "#results .externcrate"
4848

4949
// Checking that the text for the "title" is correct (the "All" comes from the "<select>").
5050
assert-text: ("#search-settings", "Results for test in All", STARTS_WITH)
51+
52+
// Checking the display of the crate filter.
53+
// We start with the light theme.
54+
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
55+
reload:
56+
57+
timeout: 2000
58+
wait-for: "#crate-search"
59+
assert-css: ("#crate-search", {
60+
"border": "1px solid rgb(224, 224, 224)",
61+
"color": "rgb(0, 0, 0)",
62+
"background-color": "rgb(255, 255, 255)",
63+
})
64+
65+
// We now check the dark theme.
66+
click: "#settings-menu"
67+
wait-for: "#settings"
68+
click: "#theme-dark"
69+
wait-for-css: ("#crate-search", {
70+
"border": "1px solid rgb(240, 240, 240)",
71+
"color": "rgb(17, 17, 17)",
72+
"background-color": "rgb(240, 240, 240)",
73+
})
74+
75+
// And finally we check the ayu theme.
76+
click: "#theme-ayu"
77+
wait-for-css: ("#crate-search", {
78+
"border": "1px solid rgb(66, 76, 87)",
79+
"color": "rgb(197, 197, 197)",
80+
"background-color": "rgb(20, 25, 32)",
81+
})

0 commit comments

Comments
 (0)