Skip to content

Commit 93ff9d4

Browse files
committed
Add gui-test for theme changing
1 parent cf814b1 commit 93ff9d4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

gui-tests/theme.goml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// setting local-storage emulates how we detect rustdoc changing the theme, we
2+
// only run this detection on rustdoc pages so must change there before visiting
3+
// other pages
4+
5+
// on rustdoc pages we only control the .nav-container and its descendants, on
6+
// the crate page we control the whole page
7+
8+
go-to: |DOC_PATH| + "/sysinfo"
9+
set-local-storage: { "rustdoc-theme": null }
10+
assert-css: (".nav-container", { "background-color": "rgb(255, 255, 255)" })
11+
go-to: |DOC_PATH| + "/crate/sysinfo"
12+
assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
13+
14+
go-to: |DOC_PATH| + "/sysinfo"
15+
set-local-storage: { "rustdoc-theme": "ayu" }
16+
assert-css: (".nav-container", { "background-color": "rgb(15, 20, 25)" })
17+
go-to: |DOC_PATH| + "/crate/sysinfo"
18+
assert-css: ("body", { "background-color": "rgb(15, 20, 25)" })

0 commit comments

Comments
 (0)