summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-gui/theme-defaults.goml
blob: 2cc5d716cfefe618671c8cca4964dc9257eff99e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Ensure that the theme picker always starts with the actual defaults.
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
click: "#settings-menu"
wait-for: "#theme-system-preference"
assert: "#theme-system-preference:checked"
assert: "#preferred-light-theme-light:checked"
assert: "#preferred-dark-theme-dark:checked"
assert-false: "#preferred-dark-theme-ayu:checked"

// Test legacy migration from old theme setup without system-preference matching.
// See https://github.com/rust-lang/rust/pull/77809#issuecomment-707875732
set-local-storage: {
    "rustdoc-preferred-light-theme": null,
    "rustdoc-preferred-dark-theme": null,
    "rustdoc-use-system-theme": null,
    "rustdoc-theme": "ayu"
}
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
click: "#settings-menu"
wait-for: "#theme-system-preference"
assert: "#theme-system-preference:checked"
assert: "#preferred-light-theme-light:checked"
assert-false: "#preferred-dark-theme-dark:checked"
assert: "#preferred-dark-theme-ayu:checked"