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