2022-01-21 20:41:47 +01:00
|
|
|
// Checks that the search results have the expected width.
|
2021-05-22 16:41:26 +02:00
|
|
|
goto: file://|DOC_PATH|/test_docs/index.html
|
|
|
|
size: (900, 1000)
|
|
|
|
write: (".search-input", "test")
|
2022-07-16 13:53:43 +02:00
|
|
|
// To be SURE that the search will be run.
|
|
|
|
press-key: 'Enter'
|
2022-07-03 20:10:19 +02:00
|
|
|
wait-for: ".search-results-title"
|
2021-05-22 16:41:26 +02:00
|
|
|
// The width is returned by "getComputedStyle" which returns the exact number instead of the
|
|
|
|
// CSS rule which is "50%"...
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
assert-css: (".search-results div.desc", {"width": "295px"})
|
2021-05-22 16:41:26 +02:00
|
|
|
size: (600, 100)
|
|
|
|
// As counter-intuitive as it may seem, in this width, the width is "100%", which is why
|
|
|
|
// when computed it's larger.
|
2021-06-19 12:56:55 +02:00
|
|
|
assert-css: (".search-results div.desc", {"width": "570px"})
|
2022-07-09 15:54:36 +02:00
|
|
|
|
|
|
|
// Check that the crate filter `<select>` is correctly handled when it goes to next line.
|
|
|
|
// To do so we need to update the length of one of its `<option>`.
|
|
|
|
size: (900, 900)
|
|
|
|
|
|
|
|
// First we check the current width and position.
|
2022-07-20 03:52:16 +02:00
|
|
|
assert-css: ("#crate-search", {"width": "218px"})
|
2022-07-09 15:54:36 +02:00
|
|
|
compare-elements-position-near: (
|
|
|
|
"#crate-search",
|
2022-07-03 20:10:19 +02:00
|
|
|
".search-results-title",
|
2022-07-09 15:54:36 +02:00
|
|
|
{"y": 5},
|
|
|
|
)
|
|
|
|
|
2022-07-03 20:10:19 +02:00
|
|
|
// FIXME: Fix and re-enable these tests!
|
2022-07-09 15:54:36 +02:00
|
|
|
|
2022-07-03 20:10:19 +02:00
|
|
|
// // First we check the current width and position.
|
|
|
|
// assert-css: ("#crate-search", {"width": "222px"})
|
|
|
|
// compare-elements-position-near: (
|
|
|
|
// "#crate-search",
|
|
|
|
// "#search-settings .search-results-title",
|
|
|
|
// {"y": 5},
|
|
|
|
// )
|
|
|
|
//
|
|
|
|
// // Then we update the text of one of the `<option>`.
|
|
|
|
// text: (
|
|
|
|
// "#crate-search option",
|
|
|
|
// "sdjfaksdjfaksjdbfkadsbfkjsadbfkdsbkfbsadkjfbkdsabfkadsfkjdsafa",
|
|
|
|
// )
|
|
|
|
//
|
|
|
|
// // Then we compare again.
|
|
|
|
// assert-css: ("#crate-search", {"width": "640px"})
|
|
|
|
// compare-elements-position-near-false: (
|
|
|
|
// "#crate-search",
|
|
|
|
// "#search-settings .search-results-title",
|
|
|
|
// {"y": 5},
|
|
|
|
// )
|
|
|
|
// // And we check that the `<select>` isn't bigger than its container.
|
|
|
|
// assert-css: ("#search", {"width": "640px"})
|