1 // Checks that the search results have the expected width.
2 goto: file://|DOC_PATH|/test_docs/index.html
4 write: (".search-input", "test")
5 wait-for: "#search-settings"
6 // The width is returned by "getComputedStyle" which returns the exact number instead of the
7 // CSS rule which is "50%"...
8 assert-css: (".search-results div.desc", {"width": "295px"})
10 // As counter-intuitive as it may seem, in this width, the width is "100%", which is why
11 // when computed it's larger.
12 assert-css: (".search-results div.desc", {"width": "570px"})
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>`.
18 // First we check the current width and position.
19 assert-css: ("#crate-search", {"width": "222px"})
20 compare-elements-position-near: (
22 "#search-settings .search-results-title",
26 // Then we update the text of one of the `<option>`.
28 "#crate-search option",
29 "sdjfaksdjfaksjdbfkadsbfkjsadbfkdsbkfbsadkjfbkdsabfkadsfkjdsafa",
32 // Then we compare again.
33 assert-css: ("#crate-search", {"width": "640px"})
34 compare-elements-position-near-false: (
36 "#search-settings .search-results-title",
39 // And we check that the `<select>` isn't bigger than its container.
40 assert-css: ("#search", {"width": "640px"})