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-mobile.goml | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/test/rustdoc-gui/toggle-docs-mobile.goml (limited to 'src/test/rustdoc-gui/toggle-docs-mobile.goml') diff --git a/src/test/rustdoc-gui/toggle-docs-mobile.goml b/src/test/rustdoc-gui/toggle-docs-mobile.goml new file mode 100644 index 000000000..ee6bc3cf7 --- /dev/null +++ b/src/test/rustdoc-gui/toggle-docs-mobile.goml @@ -0,0 +1,33 @@ +// Checks that the documentation toggles on mobile have the correct position, style and work +// as expected. +goto: file://|DOC_PATH|/test_docs/struct.Foo.html +size: (433, 600) +assert-attribute: (".top-doc", {"open": ""}) +click: (4, 270) // This is the position of the top doc comment toggle +assert-attribute-false: (".top-doc", {"open": ""}) +click: (4, 270) +assert-attribute: (".top-doc", {"open": ""}) +// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked. +click: (3, 270) +assert-attribute: (".top-doc", {"open": ""}) + +// Assert the position of the toggle on the top doc block. +assert-position: (".top-doc summary::before", {"x": 4}) +// Assert the position of the toggle on the impl block. +assert-position: ("#implementations-list > details > summary::before", {"x": 4}) +// Assert the position of the toggle on a method. +assert-position: ( + "#trait-implementations-list .impl-items .method-toggle > summary::before", + {"x": 4}, +) + +// Now we do the same but with a little bigger width +size: (600, 600) +assert-attribute: (".top-doc", {"open": ""}) +click: (4, 270) // New Y position since all search elements are back on one line. +assert-attribute-false: (".top-doc", {"open": ""}) +click: (4, 270) +assert-attribute: (".top-doc", {"open": ""}) +// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked. +click: (3, 270) +assert-attribute: (".top-doc", {"open": ""}) -- cgit v1.2.3