]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/escape-key.goml
Rollup merge of #86101 - glittershark:bound-as-mut-doc-fix, r=m-ou-se
[rust.git] / src / test / rustdoc-gui / escape-key.goml
1 goto: file://|DOC_PATH|/test_docs/index.html
2 // First, we check that the search results are hidden when the Escape key is pressed.
3 write: (".search-input", "test")
4 wait-for: "#search > h1" // The search element is empty before the first search 
5 assert: ("#search", "class", "content")
6 assert: ("#main", "class", "content hidden")
7 press-key: "Escape"
8 assert: ("#search", "class", "content hidden")
9 assert: ("#main", "class", "content")
10
11 // Check that focusing the search input brings back the search results
12 focus: ".search-input"
13 assert: ("#search", "class", "content")
14 assert: ("#main", "class", "content hidden")
15
16 // Now let's check that when the help popup is displayed and we press Escape, it doesn't
17 // hide the search results too.
18 click: "#help-button"
19 assert: ("#help", "class", "")
20 press-key: "Escape"
21 assert: ("#help", "class", "hidden")
22 assert: ("#search", "class", "content")
23 assert: ("#main", "class", "content hidden")
24
25 // Check that Escape hides the search results when a search result is focused.
26 focus: ".search-input"
27 assert: ".search-input:focus"
28 press-key: "ArrowDown"
29 assert-false: ".search-input:focus"
30 assert: "#results a:focus"
31 press-key: "Escape"
32 assert: ("#help", "class", "hidden")
33 assert: ("#search", "class", "content hidden")
34 assert: ("#main", "class", "content")