]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-gui/theme-in-history.goml
Merge commit '598f0909568a51de8a2d1148f55a644fd8dffad0' into sync_cg_clif-2023-01-24
[rust.git] / tests / 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: {
5     "rustdoc-theme": "dark",
6     "rustdoc-use-system-theme": "false",
7 }
8 // We reload the page so the local storage settings are being used.
9 reload:
10 assert-css: ("body", { "background-color": "rgb(53, 53, 53)" })
11 assert-local-storage: { "rustdoc-theme": "dark" }
12
13 // Now we go to the settings page.
14 goto: "file://" + |DOC_PATH| + "/settings.html"
15 wait-for: "#settings"
16 // We change the theme to "light".
17 click: "#theme-light"
18 wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
19 assert-local-storage: { "rustdoc-theme": "light" }
20
21 // We go back in history.
22 history-go-back:
23 // Confirm that we're not on the settings page.
24 assert-false: "#settings"
25 // Check that the current theme is still "light".
26 assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
27 assert-local-storage: { "rustdoc-theme": "light" }