about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-10-20 22:42:40 +0200
committerGitHub <noreply@github.com>2022-10-20 22:42:40 +0200
commit5bf18adaa235fe1df34d9d0d5a976a7ef03e446e (patch)
tree9a5069214b9689476c2c2f1ac5680921ffeeadbf /src/test
parentc6a680ebc523b77b54791cac590941652480b321 (diff)
parent8e3b89140e621c5f7450bd5a023fbad65fedfa3c (diff)
downloadrust-5bf18adaa235fe1df34d9d0d5a976a7ef03e446e.tar.gz
rust-5bf18adaa235fe1df34d9d0d5a976a7ef03e446e.zip
Rollup merge of #103296 - GuillaumeGomez:collapse-expand-shortcuts, r=notriddle
+/- shortcut now only expand/collapse, not both

Fixes https://github.com/rust-lang/rust/issues/102772.

r? ```@notriddle```
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-gui/shortcuts.goml18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/shortcuts.goml b/src/test/rustdoc-gui/shortcuts.goml
index ea6f55272ff..9068680d640 100644
--- a/src/test/rustdoc-gui/shortcuts.goml
+++ b/src/test/rustdoc-gui/shortcuts.goml
@@ -11,3 +11,21 @@ press-key: "?"
 assert-css: ("#help-button .popover", {"display": "block"})
 press-key: "Escape"
 assert-css: ("#help-button .popover", {"display": "none"})
+// Checking doc collapse and expand.
+// It should be displaying a "-":
+assert-text: ("#toggle-all-docs", "[\u2212]")
+press-key: "-"
+wait-for-text: ("#toggle-all-docs", "[+]")
+assert-attribute: ("#toggle-all-docs", {"class": "will-expand"})
+// Pressing it again shouldn't do anything.
+press-key: "-"
+assert-text: ("#toggle-all-docs", "[+]")
+assert-attribute: ("#toggle-all-docs", {"class": "will-expand"})
+// Expanding now.
+press-key: "+"
+wait-for-text: ("#toggle-all-docs", "[\u2212]")
+assert-attribute: ("#toggle-all-docs", {"class": ""})
+// Pressing it again shouldn't do anything.
+press-key: "+"
+assert-text: ("#toggle-all-docs", "[\u2212]")
+assert-attribute: ("#toggle-all-docs", {"class": ""})