about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-04-02 21:28:25 +0900
committerGitHub <noreply@github.com>2021-04-02 21:28:25 +0900
commit1dfbca926660e3a9de0ca9e53a4fce72dc80650c (patch)
tree01015dd6fd6e2eec6df4c8688976258a679b1b6c
parent39059fb42997e3090eaf0a937771a5da7b3c3f24 (diff)
parentf13135070cf8b973673f2383e283e3d8af26a794 (diff)
downloadrust-1dfbca926660e3a9de0ca9e53a4fce72dc80650c.tar.gz
rust-1dfbca926660e3a9de0ca9e53a4fce72dc80650c.zip
Rollup merge of #83754 - GuillaumeGomez:search-tab-behaviour, r=jyn514
Add test to ensure search tabs behaviour

It adds a GUI test for https://github.com/rust-lang/rust/pull/80382.

r? ```@jyn514```
-rw-r--r--src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml b/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml
new file mode 100644
index 00000000000..a4df102d245
--- /dev/null
+++ b/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml
@@ -0,0 +1,21 @@
+goto: file://|DOC_PATH|/index.html
+write: (".search-input", "Foo")
+// Waiting for the search results to appear...
+wait-for: "#titles"
+assert: ("#titles > button:nth-of-type(1)", "class", "selected")
+
+// To go back to the original "state"
+goto: file://|DOC_PATH|/index.html
+write: (".search-input", "-> String")
+// Waiting for the search results to appear...
+wait-for: "#titles"
+// With this search, only the last tab shouldn't be empty so it should be selected.
+assert: ("#titles > button:nth-of-type(3)", "class", "selected")
+
+// To go back to the original "state"
+goto: file://|DOC_PATH|/index.html
+write: (".search-input", "-> Something")
+// Waiting for the search results to appear...
+wait-for: "#titles"
+// With this search, all the tabs are empty so the first one should remain selected.
+assert: ("#titles > button:nth-of-type(1)", "class", "selected")