Skip to content

Commit 9d5e6e2

Browse files
Add GUI test for search result crate filter dropdown
1 parent 0201f2f commit 9d5e6e2

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/test/rustdoc-gui/search-result-display.goml

+28
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,31 @@ size: (600, 100)
1010
// As counter-intuitive as it may seem, in this width, the width is "100%", which is why
1111
// when computed it's larger.
1212
assert-css: (".search-results div.desc", {"width": "570px"})
13+
14+
// Check that the crate filter `<select>` is correctly handled when it goes to next line.
15+
// To do so we need to update the length of one of its `<option>`.
16+
size: (900, 900)
17+
18+
// First we check the current width and position.
19+
assert-css: ("#crate-search", {"width": "222px"})
20+
compare-elements-position-near: (
21+
"#crate-search",
22+
"#search-settings .search-results-title",
23+
{"y": 5},
24+
)
25+
26+
// Then we update the text of one of the `<option>`.
27+
text: (
28+
"#crate-search option",
29+
"sdjfaksdjfaksjdbfkadsbfkjsadbfkdsbkfbsadkjfbkdsabfkadsfkjdsafa",
30+
)
31+
32+
// Then we compare again.
33+
assert-css: ("#crate-search", {"width": "640px"})
34+
compare-elements-position-near-false: (
35+
"#crate-search",
36+
"#search-settings .search-results-title",
37+
{"y": 5},
38+
)
39+
// And we check that the `<select>` isn't bigger than its container.
40+
assert-css: ("#search", {"width": "640px"})

0 commit comments

Comments
 (0)