1- // This test checks that fields are displayed as expected (one by line).
2- go-to: "file://" + |DOC_PATH| + "/test_docs/fields/struct.Struct.html"
3- store-position: ("#structfield\.a", {"y": a_y})
4- store-position: ("#structfield\.b", {"y": b_y})
5- assert: |a_y| < |b_y|
1+ // This test checks that fields are displayed as expected (one by line) and they are surrounded
2+ // by margins.
63
7- go-to: "file://" + |DOC_PATH| + "/test_docs/fields/union.Union.html"
8- store-position: ("#structfield\.a", {"y": a_y})
9- store-position: ("#structfield\.b", {"y": b_y})
10- assert: |a_y| < |b_y|
4+ define-function: (
5+ "check-fields",
6+ [path, selector_1, selector_2],
7+ block {
8+ go-to: "file://" + |DOC_PATH| + "/test_docs/fields/" + |path|
9+ store-position: (|selector_1|, {"y": a_y})
10+ store-position: (|selector_2|, {"y": b_y})
11+ assert: |a_y| < |b_y|
12+
13+ // Check the margins.
14+ assert-css: (".structfield.section-header", {
15+ "margin-top": "9.6px",
16+ "margin-bottom": "9.6px",
17+ "margin-left": "0px",
18+ "margin-right": "0px",
19+ }, ALL)
20+ }
21+ )
22+
23+ call-function: ("check-fields", {
24+ "path": "struct.Struct.html",
25+ "selector_1": "#structfield\.a",
26+ "selector_2": "#structfield\.b",
27+ })
28+
29+ call-function: ("check-fields", {
30+ "path": "union.Union.html",
31+ "selector_1": "#structfield\.a",
32+ "selector_2": "#structfield\.b",
33+ })
1134
1235go-to: "file://" + |DOC_PATH| + "/test_docs/fields/enum.Enum.html"
1336store-position: ("#variant\.A\.field\.a", {"y": a_y})
@@ -16,3 +39,11 @@ assert: |a_y| < |b_y|
1639store-position: ("#variant\.B\.field\.a", {"y": a_y})
1740store-position: ("#variant\.B\.field\.b", {"y": b_y})
1841assert: |a_y| < |b_y|
42+
43+ // Check the margins.
44+ assert-css: (".sub-variant-field .section-header", {
45+ "margin-top": "0px",
46+ "margin-bottom": "0px",
47+ "margin-left": "0px",
48+ "margin-right": "0px",
49+ }, ALL)
0 commit comments