Skip to content

Commit 8f00bd5

Browse files
committed
adjust broken rustdoc gui tests
1 parent 463ad44 commit 8f00bd5

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

tests/rustdoc-gui/search-result-color.goml

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include: "utils.goml"
55
define-function: (
66
"check-search-color",
77
[
8-
theme, count_color, desc_color, path_color, bottom_border_color, keyword_color,
8+
theme, count_color, path_color, bottom_border_color, keyword_color,
99
struct_color, associatedtype_color, tymethod_color, method_color, structfield_color,
1010
structfield_hover_color, macro_color, fn_color, hover_path_color, hover_background,
1111
attribute_color, grey
@@ -21,10 +21,6 @@ define-function: (
2121
{"color": |count_color|},
2222
ALL,
2323
)
24-
assert-css: (
25-
"//*[@class='desc'][normalize-space()='Just a normal struct.']",
26-
{"color": |desc_color|},
27-
)
2824
assert-css: (
2925
"//*[@class='result-name']//*[normalize-space()='test_docs::']",
3026
{"color": |path_color|},
@@ -97,16 +93,6 @@ define-function: (
9793
ALL,
9894
)
9995

100-
// Checking color and background on hover.
101-
move-cursor-to: "//*[@class='desc'][normalize-space()='Just a normal struct.']"
102-
assert-css: (
103-
"//*[@class='result-name']//*[normalize-space()='test_docs::']",
104-
{"color": |hover_path_color|},
105-
)
106-
assert-css: (
107-
"//*[@class='result-name']//*[normalize-space()='test_docs::']/ancestor::a",
108-
{"color": |hover_path_color|, "background-color": |hover_background|},
109-
)
11096
}
11197
)
11298

@@ -157,7 +143,6 @@ show-text: true
157143
call-function: ("check-search-color", {
158144
"theme": "ayu",
159145
"count_color": "#888",
160-
"desc_color": "#c5c5c5",
161146
"path_color": "#0096cf",
162147
"bottom_border_color": "#aaa3",
163148
"keyword_color": "#39afd7",
@@ -179,7 +164,6 @@ call-function: ("check-search-color", {
179164
call-function: ("check-search-color", {
180165
"theme": "dark",
181166
"count_color": "#888",
182-
"desc_color": "#ddd",
183167
"path_color": "#ddd",
184168
"bottom_border_color": "#aaa3",
185169
"keyword_color": "#d2991d",
@@ -201,7 +185,6 @@ call-function: ("check-search-color", {
201185
call-function: ("check-search-color", {
202186
"theme": "light",
203187
"count_color": "#888",
204-
"desc_color": "#000",
205188
"path_color": "#000",
206189
"bottom_border_color": "#aaa3",
207190
"keyword_color": "#3873ad",
@@ -226,27 +209,51 @@ call-function: ("perform-search", {"query": "thisisanalias"})
226209

227210
define-function: (
228211
"check-alias",
229-
[theme, alias, grey],
212+
[theme, alias, grey, desc_color, hover_path_color, hover_background],
230213
block {
231214
call-function: ("switch-theme", {"theme": |theme|})
232215
// Checking that the colors for the alias element are the ones expected.
233216
assert-css: (".result-name .path .alias", {"color": |alias|})
234217
assert-css: (".result-name .path .alias > .grey", {"color": |grey|})
218+
assert-css: (
219+
"//*[@class='desc'][normalize-space()='Just a normal enum.']",
220+
{"color": |desc_color|},
221+
)
222+
// Checking color and background on hover.
223+
move-cursor-to: "//*[@class='desc'][normalize-space()='Just a normal enum.']"
224+
assert-css: (
225+
"//*[@class='result-name']//*[normalize-space()='test_docs::']",
226+
{"color": |hover_path_color|},
227+
)
228+
assert-css: (
229+
"//*[@class='result-name']//*[normalize-space()='test_docs::']/ancestor::a",
230+
{"color": |hover_path_color|, "background-color": |hover_background|},
231+
)
232+
235233
},
236234
)
237235

238236
call-function: ("check-alias", {
239237
"theme": "ayu",
240238
"alias": "#c5c5c5",
241239
"grey": "#999",
240+
"desc_color": "#c5c5c5",
241+
"hover_path_color": "#fff",
242+
"hover_background": "#3c3c3c",
242243
})
243244
call-function: ("check-alias", {
244245
"theme": "dark",
245246
"alias": "#fff",
246247
"grey": "#ccc",
248+
"desc_color": "#ddd",
249+
"hover_path_color": "#ddd",
250+
"hover_background": "#616161",
247251
})
248252
call-function: ("check-alias", {
249253
"theme": "light",
250254
"alias": "#000",
251255
"grey": "#999",
256+
"desc_color": "#000",
257+
"hover_path_color": "#000",
258+
"hover_background": "#ccc",
252259
})

tests/rustdoc-gui/search-tab.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ call-function: ("check-colors", {
7979
set-window-size: (851, 600)
8080

8181
// Check the size and count in tabs
82-
assert-text: ("#search-tabs > button:nth-child(1) > .count", " (27) ")
82+
assert-text: ("#search-tabs > button:nth-child(1) > .count", " (22) ")
8383
assert-text: ("#search-tabs > button:nth-child(2) > .count", " (7)  ")
8484
assert-text: ("#search-tabs > button:nth-child(3) > .count", " (0)  ")
8585
store-property: ("#search-tabs > button:nth-child(1)", {"offsetWidth": buttonWidth})

0 commit comments

Comments
 (0)