]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/search-result-display.goml
Rollup merge of #103382 - compiler-errors:anon-apit-lt-region-ice, r=cjgillot
[rust.git] / src / test / rustdoc-gui / search-result-display.goml
1 // Checks that the search results have the expected width.
2 goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
3 size: (900, 1000)
4 write: (".search-input", "test")
5 // To be SURE that the search will be run.
6 press-key: 'Enter'
7 wait-for: "#crate-search"
8 // The width is returned by "getComputedStyle" which returns the exact number instead of the
9 // CSS rule which is "50%"...
10 assert-css: (".search-results div.desc", {"width": "318px"})
11 size: (600, 100)
12 // As counter-intuitive as it may seem, in this width, the width is "100%", which is why
13 // when computed it's larger.
14 assert-css: (".search-results div.desc", {"width": "566px"})
15
16 // The result set is all on one line.
17 assert-css: (".search-results .result-name > span", {"display": "inline"})
18
19 // Check that the crate filter `<select>` is correctly handled when it goes to next line.
20 // To do so we need to update the length of one of its `<option>`.
21 size: (900, 900)
22
23 // First we check the current width, height and position.
24 assert-css: ("#crate-search", {"width": "223px"})
25 assert-css: (".search-results-title", {"height": "44px", "width": "336px"})
26
27 // Then we update the text of one of the `<option>`.
28 text: (
29     "#crate-search option",
30     "sdjfaksdjfaksjdbfkadsbfkjsadbfkdsbkfbsadkjfbkdsabfkadsfkjdsafa",
31 )
32
33 // Then we compare again to confirm the height didn't change.
34 assert-css: ("#crate-search", {"width": "527px"})
35 assert-css: (".search-results-title", {"height": "44px", "width": "640px"})
36 // And we check that the `<select>` isn't bigger than its container (".search-results-title").
37 assert-css: ("#search", {"width": "640px"})