Files
rust/tests/rustdoc-gui/collapse-trait-impl.goml

27 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2025-05-10 19:24:59 +02:00
// Checks that individual trait impls can only be collapsed via clicking directly on the summary element
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
assert-attribute: ("details:has(#trait-impl-link-in-summary)", {"open": ""})
// Collapse the trait impl doc. The actual clickable area is outside the element, hence offset.
click-with-offset: ("summary:has(#trait-impl-link-in-summary)", {"x": -15, "y": 5})
assert-attribute-false: ("details:has(#trait-impl-link-in-summary)", {"open": ""})
2025-05-11 08:02:19 +02:00
click-with-offset: ("summary:has(#trait-impl-link-in-summary)", {"x": -15, "y": 5})
assert-attribute: ("details:has(#trait-impl-link-in-summary)", {"open": ""})
2025-05-10 19:24:59 +02:00
// Clicks on the text should be ignored
click: "summary:has(#trait-impl-link-in-summary) > .impl"
2025-05-11 08:02:19 +02:00
assert-attribute: ("details:has(#trait-impl-link-in-summary)", {"open": ""})
2025-05-10 19:24:59 +02:00
// But links should still work
2025-05-10 19:48:13 +02:00
click: "summary:has(#trait-impl-link-in-summary) a:has(#trait-impl-link-in-summary)"
2025-05-10 19:24:59 +02:00
assert-window-property-false: ({"pageYOffset": "0"})
2025-05-11 08:02:19 +02:00
assert-attribute: ("details:has(#trait-impl-link-in-summary)", {"open": ""})
2025-05-10 19:24:59 +02:00
// As well as clicks on elements within links
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
assert-window-property: ({"pageYOffset": "0"})
click: "#trait-impl-link-in-summary"
assert-window-property-false: ({"pageYOffset": "0"})
2025-05-11 08:02:19 +02:00
assert-attribute: ("details:has(#trait-impl-link-in-summary)", {"open": ""})