2022-05-21 08:05:56 -05:00
|
|
|
// This ensures that the `<details>`/`<summary>` elements are displayed as expected.
|
2024-04-05 14:38:55 -05:00
|
|
|
include: "utils.goml"
|
2023-04-11 12:11:34 -05:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/details/struct.Details.html"
|
2022-05-21 08:05:56 -05:00
|
|
|
show-text: true
|
2024-04-05 14:38:55 -05:00
|
|
|
call-function: ("switch-theme", {"theme": "dark"})
|
2022-05-21 08:05:56 -05:00
|
|
|
|
|
|
|
// We first check that the headers in the `.top-doc` doc block still have their
|
|
|
|
// bottom border.
|
2022-02-25 08:57:01 -06:00
|
|
|
assert-text: (".top-doc .docblock > h3", "§Hello")
|
2022-05-21 08:05:56 -05:00
|
|
|
assert-css: (
|
|
|
|
".top-doc .docblock > h3",
|
2023-05-11 04:34:19 -05:00
|
|
|
{"border-bottom": "1px solid #d2d2d2"},
|
2022-05-21 08:05:56 -05:00
|
|
|
)
|
|
|
|
// We now check that the `<summary>` doesn't have a bottom border and has the correct display.
|
|
|
|
assert-css: (
|
|
|
|
".top-doc .docblock summary h4",
|
2022-09-19 20:12:21 -05:00
|
|
|
{"border-bottom-width": "0px"},
|
2022-05-21 08:05:56 -05:00
|
|
|
)
|
|
|
|
// This allows to ensure that summary is on one line only!
|
|
|
|
assert-property: (".top-doc .docblock summary h4", {"offsetHeight": "33"})
|
|
|
|
assert-css: (".top-doc .docblock summary h4", {"margin-top": "15px", "margin-bottom": "5px"})
|
|
|
|
// So `33 + 15 + 5` == `53`
|
|
|
|
assert-property: (".top-doc .docblock summary", {"offsetHeight": "53"})
|
2022-10-21 12:48:41 -05:00
|
|
|
|
|
|
|
// We now check the `<summary>` on a method.
|
|
|
|
assert-css: (
|
|
|
|
".method-toggle .docblock summary h4",
|
|
|
|
{"border-bottom-width": "0px"},
|
|
|
|
)
|
|
|
|
// This allows to ensure that summary is on one line only!
|
|
|
|
assert-property: (".method-toggle .docblock summary h4", {"offsetHeight": "30"})
|
|
|
|
assert-css: (".method-toggle .docblock summary h4", {"margin-top": "15px", "margin-bottom": "5px"})
|
|
|
|
// So `30 + 15 + 5` == `50`
|
|
|
|
assert-property: (".method-toggle .docblock summary", {"offsetHeight": "50"})
|