Skip to content

Commit 2d335c4

Browse files
Add GUI regression test for setting's cog color
1 parent ca6cf52 commit 2d335c4

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// This test ensures that the icon of the settings button looks as expected on
2+
// all themes.
3+
include: "utils.goml"
4+
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
5+
show-text: true
6+
7+
define-function: (
8+
"check-image",
9+
[theme, filter],
10+
block {
11+
call-function: ("switch-theme", {"theme": |theme|})
12+
assert-css: ("#settings-menu > a::before", {
13+
"filter": |filter|,
14+
"width": "22px",
15+
"height": "22px",
16+
})
17+
}
18+
)
19+
20+
call-function: ("check-image", {
21+
"theme": "ayu",
22+
"filter": "invert(1)",
23+
})
24+
call-function: ("check-image", {
25+
"theme": "dark",
26+
"filter": "none",
27+
})
28+
call-function: ("check-image", {
29+
"theme": "light",
30+
"filter": "none",
31+
})

tests/rustdoc-gui/settings.goml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// This test ensures that the settings menu display is working as expected and that
22
// the settings page is also rendered as expected.
3-
include: "utils.goml"
43
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
54
show-text: true // needed when we check for colors below.
65
// First, we check that the settings page doesn't exist.

0 commit comments

Comments
 (0)