diff options
| author | Eric Huss <eric@huss.org> | 2022-01-30 08:37:51 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-30 08:37:51 -0800 |
| commit | 5e4837840e25bad824e8e2d17c1bb8509a424ce0 (patch) | |
| tree | a37ec5183435b824a742aa518164571e58a6e9cf | |
| parent | cee571e6062a200a84b2fb4e3c216292e6a2ac13 (diff) | |
| parent | 2604968d03c3b8b21efb17f570fa5a6cff7ec140 (diff) | |
| download | rust-5e4837840e25bad824e8e2d17c1bb8509a424ce0.tar.gz rust-5e4837840e25bad824e8e2d17c1bb8509a424ce0.zip | |
Rollup merge of #93475 - GuillaumeGomez:theme-in-history, r=jsha
Add test to ensure that theme is applied correctly when going back in history Fixes #93258. r? `@jsha`
| -rw-r--r-- | src/test/rustdoc-gui/theme-in-history.goml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/theme-in-history.goml b/src/test/rustdoc-gui/theme-in-history.goml new file mode 100644 index 00000000000..b53799188ef --- /dev/null +++ b/src/test/rustdoc-gui/theme-in-history.goml @@ -0,0 +1,25 @@ +// Ensures that the theme is working when going back in history. +goto: file://|DOC_PATH|/test_docs/index.html +// Set the theme to dark. +local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"} +// We reload the page so the local storage settings are being used. +reload: +assert-css: ("body", { "background-color": "rgb(53, 53, 53)" }) +assert-local-storage: { "rustdoc-theme": "dark" } + +// Now we go to the settings page. +click: "#settings-menu" +wait-for: ".settings" +// We change the theme to "light". +click: "#theme-light" +wait-for: 250 +assert-css: ("body", { "background-color": "rgb(255, 255, 255)" }) +assert-local-storage: { "rustdoc-theme": "light" } + +// We go back in history. +history-go-back: +// Confirm that we're not on the settings page. +assert-false: ".settings" +// Check that the current theme is still "light". +assert-css: ("body", { "background-color": "rgb(255, 255, 255)" }) +assert-local-storage: { "rustdoc-theme": "light" } |
