]> git.proxmox.com Git - rustc.git/blobdiff - src/test/rustdoc-gui/shortcuts.goml
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / rustdoc-gui / shortcuts.goml
index 1f20a0eaa9982d21630b0fcad056e01356bacabf..9068680d640c18ea111b95a011d901570bc9c998 100644 (file)
@@ -1,5 +1,5 @@
 // Check that the various shortcuts are working.
-goto: file://|DOC_PATH|/test_docs/index.html
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
 // We first check that the search input isn't already focused.
 assert-false: "input.search-input:focus"
 press-key: "s"
@@ -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": ""})