]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/theme-in-history.goml
Rollup merge of #95373 - RalfJung:invalid_value, r=davidtwco
[rust.git] / src / test / rustdoc-gui / theme-in-history.goml
1 // Ensures that the theme is working when going back in history.
2 goto: file://|DOC_PATH|/test_docs/index.html
3 // Set the theme to dark.
4 local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"}
5 // We reload the page so the local storage settings are being used.
6 reload:
7 assert-css: ("body", { "background-color": "rgb(53, 53, 53)" })
8 assert-local-storage: { "rustdoc-theme": "dark" }
9
10 // Now we go to the settings page.
11 click: "#settings-menu"
12 wait-for: ".settings"
13 // We change the theme to "light".
14 click: "#theme-light"
15 wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
16 assert-local-storage: { "rustdoc-theme": "light" }
17
18 // We go back in history.
19 history-go-back:
20 // Confirm that we're not on the settings page.
21 assert-false: ".settings"
22 // Check that the current theme is still "light".
23 assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
24 assert-local-storage: { "rustdoc-theme": "light" }