]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-gui/docblock-details.goml
Rollup merge of #106715 - BoxyUwU:new_solver_triagebot, r=lcnr
[rust.git] / tests / rustdoc-gui / docblock-details.goml
1 // This ensures that the `<details>`/`<summary>` elements are displayed as expected.
2 goto: "file://" + |DOC_PATH| + "/test_docs/details/struct.Details.html"
3 show-text: true
4 local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
5 reload:
6
7 // We first check that the headers in the `.top-doc` doc block still have their
8 // bottom border.
9 assert-text: (".top-doc .docblock > h3", "Hello")
10 assert-css: (
11     ".top-doc .docblock > h3",
12     {"border-bottom": "1px solid rgb(210, 210, 210)"},
13 )
14 // We now check that the `<summary>` doesn't have a bottom border and has the correct display.
15 assert-css: (
16     ".top-doc .docblock summary h4",
17     {"border-bottom-width": "0px"},
18 )
19 // This allows to ensure that summary is on one line only!
20 assert-property: (".top-doc .docblock summary h4", {"offsetHeight": "33"})
21 assert-css: (".top-doc .docblock summary h4", {"margin-top": "15px", "margin-bottom": "5px"})
22 // So `33 + 15 + 5` == `53`
23 assert-property: (".top-doc .docblock summary", {"offsetHeight": "53"})
24
25 // We now check the `<summary>` on a method.
26 assert-css: (
27     ".method-toggle .docblock summary h4",
28     {"border-bottom-width": "0px"},
29 )
30 // This allows to ensure that summary is on one line only!
31 assert-property: (".method-toggle .docblock summary h4", {"offsetHeight": "30"})
32 assert-css: (".method-toggle .docblock summary h4", {"margin-top": "15px", "margin-bottom": "5px"})
33 // So `30 + 15 + 5` == `50`
34 assert-property: (".method-toggle .docblock summary", {"offsetHeight": "50"})