summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-gui/sidebar.goml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/rustdoc-gui/sidebar.goml (renamed from src/test/rustdoc-gui/sidebar.goml)46
1 files changed, 45 insertions, 1 deletions
diff --git a/src/test/rustdoc-gui/sidebar.goml b/tests/rustdoc-gui/sidebar.goml
index 5058630f4..9c742be05 100644
--- a/src/test/rustdoc-gui/sidebar.goml
+++ b/tests/rustdoc-gui/sidebar.goml
@@ -2,6 +2,50 @@
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert-property: (".sidebar", {"clientWidth": "200"})
show-text: true
+
+// First, check the sidebar colors.
+define-function: (
+ "check-colors",
+ (theme, color, background_color),
+ block {
+ local-storage: {
+ "rustdoc-theme": |theme|,
+ "rustdoc-use-system-theme": "false",
+ }
+ reload:
+ // Checking results colors.
+ assert-css: (".sidebar", {
+ "color": |color|,
+ "background-color": |background_color|
+ }, ALL)
+ },
+)
+
+call-function: (
+ "check-colors",
+ {
+ "theme": "ayu",
+ "color": "rgb(197, 197, 197)",
+ "background_color": "rgb(20, 25, 31)",
+ }
+)
+call-function: (
+ "check-colors",
+ {
+ "theme": "dark",
+ "color": "rgb(221, 221, 221)",
+ "background_color": "rgb(80, 80, 80)",
+ }
+)
+call-function: (
+ "check-colors",
+ {
+ "theme": "light",
+ "color": "rgb(0, 0, 0)",
+ "background_color": "rgb(245, 245, 245)",
+ }
+)
+
local-storage: {"rustdoc-theme": "light"}
// We reload the page so the local storage settings are being used.
reload:
@@ -104,4 +148,4 @@ assert-text: ("#toggle-all-docs", "[+]")
assert-property: (".sidebar", {"clientWidth": "200"})
click: "#toggle-all-docs"
assert-text: ("#toggle-all-docs", "[−]")
-assert-property: (".sidebar", {"clientWidth": "200"}) \ No newline at end of file
+assert-property: (".sidebar", {"clientWidth": "200"})