diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-10-20 11:34:40 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-10-20 11:35:12 +0200 |
| commit | 8e3b89140e621c5f7450bd5a023fbad65fedfa3c (patch) | |
| tree | 3720ea4d60e0273bc52fa531a837159c43cf41ba /src/test | |
| parent | d3c37b1dfa62f8de2690e09c8e31ac8fbbd0dd2e (diff) | |
| download | rust-8e3b89140e621c5f7450bd5a023fbad65fedfa3c.tar.gz rust-8e3b89140e621c5f7450bd5a023fbad65fedfa3c.zip | |
Add GUI tests for collapse/expand actions
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/rustdoc-gui/shortcuts.goml | 18 |
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": ""}) |
