2022-01-21 13:41:47 -06:00
|
|
|
// Checks that the documentation toggles on mobile have the correct position, style and work
|
|
|
|
// as expected.
|
2022-10-07 13:17:05 -05:00
|
|
|
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
|
2021-05-14 08:16:16 -05:00
|
|
|
size: (433, 600)
|
2021-06-22 04:11:45 -05:00
|
|
|
assert-attribute: (".top-doc", {"open": ""})
|
2022-01-13 11:54:44 -06:00
|
|
|
click: (4, 270) // This is the position of the top doc comment toggle
|
2021-06-22 04:11:45 -05:00
|
|
|
assert-attribute-false: (".top-doc", {"open": ""})
|
2022-01-13 11:54:44 -06:00
|
|
|
click: (4, 270)
|
2021-06-22 04:11:45 -05:00
|
|
|
assert-attribute: (".top-doc", {"open": ""})
|
2021-05-14 08:16:16 -05:00
|
|
|
// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked.
|
2022-01-13 11:54:44 -06:00
|
|
|
click: (3, 270)
|
2021-06-22 04:11:45 -05:00
|
|
|
assert-attribute: (".top-doc", {"open": ""})
|
2021-05-14 08:16:16 -05:00
|
|
|
|
2021-12-29 11:54:33 -06:00
|
|
|
// 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.
|
2022-03-08 11:11:29 -06:00
|
|
|
assert-position: ("#implementations-list > details > summary::before", {"x": 4})
|
2021-12-29 11:54:33 -06:00
|
|
|
// Assert the position of the toggle on a method.
|
|
|
|
assert-position: (
|
|
|
|
"#trait-implementations-list .impl-items .method-toggle > summary::before",
|
|
|
|
{"x": 4},
|
|
|
|
)
|
|
|
|
|
2021-05-14 08:16:16 -05:00
|
|
|
// Now we do the same but with a little bigger width
|
|
|
|
size: (600, 600)
|
2021-06-22 04:11:45 -05:00
|
|
|
assert-attribute: (".top-doc", {"open": ""})
|
2022-01-13 11:54:44 -06:00
|
|
|
click: (4, 270) // New Y position since all search elements are back on one line.
|
2021-06-22 04:11:45 -05:00
|
|
|
assert-attribute-false: (".top-doc", {"open": ""})
|
2022-01-13 11:54:44 -06:00
|
|
|
click: (4, 270)
|
2021-06-22 04:11:45 -05:00
|
|
|
assert-attribute: (".top-doc", {"open": ""})
|
2021-05-14 08:16:16 -05:00
|
|
|
// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked.
|
2022-01-13 11:54:44 -06:00
|
|
|
click: (3, 270)
|
2021-06-22 04:11:45 -05:00
|
|
|
assert-attribute: (".top-doc", {"open": ""})
|