@@ -36,3 +36,32 @@ click: "#settings-menu"
36
36
wait-for: "#alternative-display #settings"
37
37
assert: "#not-displayed #search"
38
38
assert: "#main-content.hidden"
39
+
40
+ // Now let's check the content of the settings menu.
41
+ local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
42
+ reload:
43
+ click: "#settings-menu"
44
+ wait-for: "#settings"
45
+
46
+ // We check that the "Use system theme" is disabled.
47
+ assert-property: ("#use-system-theme", {"checked": "false"})
48
+ assert: "//*[@class='setting-line']/*[text()='Use system theme']"
49
+ // Meaning that only the "theme" menu is showing up.
50
+ assert: ".setting-line:not(.hidden) #theme"
51
+ assert: ".setting-line.hidden #preferred-dark-theme"
52
+ assert: ".setting-line.hidden #preferred-light-theme"
53
+
54
+ // We check that the correct theme is selected.
55
+ assert-property: ("#theme .choices #theme-dark", {"checked": "true"})
56
+
57
+ // We now switch the display.
58
+ click: "#use-system-theme"
59
+ // Wait for the hidden element to show up.
60
+ wait-for: ".setting-line:not(.hidden) #preferred-dark-theme"
61
+ assert: ".setting-line:not(.hidden) #preferred-light-theme"
62
+ // Check that the theme picking is hidden.
63
+ assert: ".setting-line.hidden #theme"
64
+
65
+ // We check their text as well.
66
+ assert-text: ("#preferred-dark-theme .setting-name", "Preferred dark theme")
67
+ assert-text: ("#preferred-light-theme .setting-name", "Preferred light theme")
0 commit comments