From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/rustdoc-gui/toggle-docs.goml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/test/rustdoc-gui/toggle-docs.goml (limited to 'src/test/rustdoc-gui/toggle-docs.goml') diff --git a/src/test/rustdoc-gui/toggle-docs.goml b/src/test/rustdoc-gui/toggle-docs.goml new file mode 100644 index 000000000..63962b576 --- /dev/null +++ b/src/test/rustdoc-gui/toggle-docs.goml @@ -0,0 +1,42 @@ +// Checks that the documentation toggles have the correct position, style and work as expected. +goto: file://|DOC_PATH|/test_docs/index.html +assert-attribute: ("#main-content > details.top-doc", {"open": ""}) +assert-text: ("#toggle-all-docs", "[−]") +click: "#toggle-all-docs" +wait-for: 50 +// This is now collapsed so there shouldn't be the "open" attribute on details. +assert-attribute-false: ("#main-content > details.top-doc", {"open": ""}) +assert-text: ("#toggle-all-docs", "[+]") +click: "#toggle-all-docs" +// Not collapsed anymore so the "open" attribute should be back. +wait-for-attribute: ("#main-content > details.top-doc", {"open": ""}) +assert-text: ("#toggle-all-docs", "[−]") + +// Check that it works on non-module pages as well. +goto: file://|DOC_PATH|/test_docs/struct.Foo.html +// We first check that everything is visible. +assert-text: ("#toggle-all-docs", "[−]") +assert-attribute: ("#implementations-list details.rustdoc-toggle", {"open": ""}, ALL) +assert-attribute: ("#trait-implementations-list details.rustdoc-toggle", {"open": ""}, ALL) +assert-attribute-false: ( + "#blanket-implementations-list > details.rustdoc-toggle", + {"open": ""}, + ALL, +) + +// We collapse them all. +click: "#toggle-all-docs" +wait-for-text: ("#toggle-all-docs", "[+]") +// We check that all
are collapsed (except for the impl block ones). +assert-attribute-false: ("details.rustdoc-toggle:not(.implementors-toggle)", {"open": ""}, ALL) +assert-attribute: ("#implementations-list > details.implementors-toggle", {"open": ""}) +// We now check that the other impl blocks are collapsed. +assert-attribute-false: ( + "#blanket-implementations-list > details.rustdoc-toggle.implementors-toggle", + {"open": ""}, + ALL, +) +// We open them all again. +click: "#toggle-all-docs" +wait-for-text: ("#toggle-all-docs", "[−]") +assert-attribute: ("details.rustdoc-toggle", {"open": ""}, ALL) -- cgit v1.2.3