Skip to content

Commit

Permalink
Add GUI regression test for setting's cog color
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed May 5, 2024
1 parent 0cbebd0 commit e460901
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
31 changes: 31 additions & 0 deletions tests/rustdoc-gui/settings-button.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// This test ensures that the icon of the settings button looks as expected on
// all themes.
include: "utils.goml"
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
show-text: true

define-function: (
"check-image",
[theme, filter],
block {
call-function: ("switch-theme", {"theme": |theme|})
assert-css: ("#settings-menu > a::before", {
"filter": |filter|,
"width": "22px",
"height": "22px",
})
}
)

call-function: ("check-image", {
"theme": "ayu",
"filter": "invert(1)",
})
call-function: ("check-image", {
"theme": "dark",
"filter": "none",
})
call-function: ("check-image", {
"theme": "light",
"filter": "none",
})
1 change: 0 additions & 1 deletion tests/rustdoc-gui/settings.goml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// This test ensures that the settings menu display is working as expected and that
// the settings page is also rendered as expected.
include: "utils.goml"
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
show-text: true // needed when we check for colors below.
// First, we check that the settings page doesn't exist.
Expand Down

0 comments on commit e460901

Please sign in to comment.