Skip to content

Commit

Permalink
Add GUI tests for collapse/expand actions
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 20, 2022
1 parent d3c37b1 commit 8e3b891
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/rustdoc-gui/shortcuts.goml
Original file line number Diff line number Diff line change
Expand Up @@ -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": ""})

0 comments on commit 8e3b891

Please sign in to comment.