|
| 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 | +// FIXME: Once https://github.com/rust-lang/rust/pull/84462 is merged, add check to ensure |
| 26 | +// that Escape hides the search results when a result is focused. |
| 27 | +// press-key: "ArrowDown" |
0 commit comments