Skip to content

Commit 8e3b891

Browse files
Add GUI tests for collapse/expand actions
1 parent d3c37b1 commit 8e3b891

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/test/rustdoc-gui/shortcuts.goml

+18
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,21 @@ press-key: "?"
1111
assert-css: ("#help-button .popover", {"display": "block"})
1212
press-key: "Escape"
1313
assert-css: ("#help-button .popover", {"display": "none"})
14+
// Checking doc collapse and expand.
15+
// It should be displaying a "-":
16+
assert-text: ("#toggle-all-docs", "[\u2212]")
17+
press-key: "-"
18+
wait-for-text: ("#toggle-all-docs", "[+]")
19+
assert-attribute: ("#toggle-all-docs", {"class": "will-expand"})
20+
// Pressing it again shouldn't do anything.
21+
press-key: "-"
22+
assert-text: ("#toggle-all-docs", "[+]")
23+
assert-attribute: ("#toggle-all-docs", {"class": "will-expand"})
24+
// Expanding now.
25+
press-key: "+"
26+
wait-for-text: ("#toggle-all-docs", "[\u2212]")
27+
assert-attribute: ("#toggle-all-docs", {"class": ""})
28+
// Pressing it again shouldn't do anything.
29+
press-key: "+"
30+
assert-text: ("#toggle-all-docs", "[\u2212]")
31+
assert-attribute: ("#toggle-all-docs", {"class": ""})

0 commit comments

Comments
 (0)