rust/tests/rustdoc-gui/theme-in-history.goml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
872 B
Plaintext
Raw Normal View History

// Ensures that the theme is working when going back in history.
include: "utils.goml"
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// Set the theme to dark.
call-function: ("switch-theme", {"theme": "dark"})
assert-css: ("body", { "background-color": "#353535" })
assert-local-storage: { "rustdoc-theme": "dark" }
// Now we go to the settings page.
go-to: "file://" + |DOC_PATH| + "/settings.html"
2022-01-19 22:06:17 +00:00
wait-for: "#settings"
// We change the theme to "light".
click: "#theme-light"
wait-for-css: ("body", { "background-color": "white" })
assert-local-storage: { "rustdoc-theme": "light" }
// We go back in history.
history-go-back:
// Confirm that we're not on the settings page.
2022-01-19 22:06:17 +00:00
assert-false: "#settings"
// Check that the current theme is still "light".
assert-css: ("body", { "background-color": "white" })
assert-local-storage: { "rustdoc-theme": "light" }