]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml
Rollup merge of #95373 - RalfJung:invalid_value, r=davidtwco
[rust.git] / src / test / rustdoc-gui / search-tab-selection-if-current-is-empty.goml
1 // Checks that the first non-empty search result tab is selected if the default/currently selected
2 // one is empty.
3 goto: file://|DOC_PATH|/test_docs/index.html
4 write: (".search-input", "Foo")
5 // Waiting for the search results to appear...
6 wait-for: "#titles"
7 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
8
9 // To go back to the original "state"
10 goto: file://|DOC_PATH|/test_docs/index.html
11 write: (".search-input", "-> String")
12 // Waiting for the search results to appear...
13 wait-for: "#titles"
14 // With this search, only the last tab shouldn't be empty so it should be selected.
15 assert-attribute: ("#titles > button:nth-of-type(3)", {"class": "selected"})
16
17 // To go back to the original "state"
18 goto: file://|DOC_PATH|/test_docs/index.html
19 write: (".search-input", "-> Something")
20 // Waiting for the search results to appear...
21 wait-for: "#titles"
22 // With this search, all the tabs are empty so the first one should remain selected.
23 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})