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