Skip to content

Commit a96ccbe

Browse files
Add GUI test for badge alignment
1 parent b5e5d96 commit a96ccbe

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/test/rustdoc-gui/stab-badge.goml

+15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
// All stability badges should have rounded corners and colored backgrounds.
22
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
33
show-text: true
4+
5+
// Checking the alignment of the badges text with the item name.
6+
assert-css: (
7+
"//*[@class='item-table']//*[@class='item-left module-item']/*[@class='stab deprecated']",
8+
{"padding-top": "2px"},
9+
)
10+
assert-position: (
11+
"//*[@class='item-table']//*[@class='item-left module-item']/*[@class='stab deprecated']",
12+
{"y": 1892},
13+
)
14+
assert-position: (
15+
"//*[@class='item-table']//*[@class='item-left module-item']/*[@class='stab deprecated']/preceding-sibling::a",
16+
{"y": 1894}, // 1892 + 2 because of padding
17+
)
18+
419
define-function: (
520
"check-badge",
621
(theme, background, color),

0 commit comments

Comments
 (0)