From dfc8b6094e8dc96b8dcbde8d2d11e3a1cbab294a Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 14 May 2021 15:16:16 +0200 Subject: [PATCH] Add test for toggle on mobile size --- src/test/rustdoc-gui/toggle-docs-mobile.goml | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 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 0000000000000..fcdfc0344db80 --- /dev/null +++ b/src/test/rustdoc-gui/toggle-docs-mobile.goml @@ -0,0 +1,21 @@ +goto: file://|DOC_PATH|/test_docs/struct.Foo.html +size: (433, 600) +assert: (".top-doc", "open", "") +click: (4, 280) // This is the position of the top doc comment toggle +assert-false: (".top-doc", "open", "") +click: (4, 280) +assert: (".top-doc", "open", "") +// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked. +click: (3, 280) +assert: (".top-doc", "open", "") + +// Now we do the same but with a little bigger width +size: (600, 600) +assert: (".top-doc", "open", "") +click: (4, 240) // New Y position since all search elements are back on one line. +assert-false: (".top-doc", "open", "") +click: (4, 240) +assert: (".top-doc", "open", "") +// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked. +click: (3, 240) +assert: (".top-doc", "open", "")