]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-gui/toggle-docs-mobile.goml
Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`.
[rust.git] / tests / rustdoc-gui / toggle-docs-mobile.goml
1 // Checks that the documentation toggles on mobile have the correct position, style and work
2 // as expected.
3 goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
4 size: (433, 600)
5 assert-attribute: (".top-doc", {"open": ""})
6 click: (4, 270) // This is the position of the top doc comment toggle
7 assert-attribute-false: (".top-doc", {"open": ""})
8 click: (4, 270)
9 assert-attribute: (".top-doc", {"open": ""})
10 // To ensure that the toggle isn't over the text, we check that the toggle isn't clicked.
11 click: (3, 270)
12 assert-attribute: (".top-doc", {"open": ""})
13
14 // Assert the position of the toggle on the top doc block.
15 assert-position: (".top-doc summary::before", {"x": 4})
16 // Assert the position of the toggle on the impl block.
17 assert-position: ("#implementations-list > details > summary::before", {"x": 4})
18 // Assert the position of the toggle on a method.
19 assert-position: (
20     "#trait-implementations-list .impl-items .method-toggle > summary::before",
21     {"x": 4},
22 )
23
24 // Now we do the same but with a little bigger width
25 size: (600, 600)
26 assert-attribute: (".top-doc", {"open": ""})
27 click: (4, 270) // New Y position since all search elements are back on one line.
28 assert-attribute-false: (".top-doc", {"open": ""})
29 click: (4, 270)
30 assert-attribute: (".top-doc", {"open": ""})
31 // To ensure that the toggle isn't over the text, we check that the toggle isn't clicked.
32 click: (3, 270)
33 assert-attribute: (".top-doc", {"open": ""})