@@ -48,7 +48,8 @@ assert: ".setting-line.hidden #preferred-light-theme"
48
48
assert-property: ("#theme .choices #theme-dark", {"checked": "true"})
49
49
50
50
// Some style checks...
51
- // First we check the "default" display.
51
+ move-cursor-to: "#settings-menu > a"
52
+ // First we check the "default" display for radio buttons.
52
53
assert-css: (
53
54
"#theme-dark",
54
55
{
@@ -57,7 +58,7 @@ assert-css: (
57
58
},
58
59
)
59
60
assert-css: ("#theme-light", {"border-color": "rgb(221, 221, 221)", "box-shadow": "none"})
60
- // Let's start with the hover.
61
+ // Let's start with the hover for radio buttons .
61
62
move-cursor-to: "#theme-dark"
62
63
assert-css: (
63
64
"#theme-dark",
@@ -69,7 +70,7 @@ assert-css: (
69
70
move-cursor-to: "#theme-light"
70
71
assert-css: ("#theme-light", {"border-color": "rgb(33, 150, 243)", "box-shadow": "none"})
71
72
move-cursor-to: "#theme-ayu"
72
- // Let's now check with the focus.
73
+ // Let's now check with the focus for radio buttons .
73
74
focus: "#theme-dark"
74
75
assert-css: (
75
76
"#theme-dark",
@@ -86,7 +87,7 @@ assert-css: (
86
87
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
87
88
},
88
89
)
89
- // Now we check we both focus and hover.
90
+ // Now we check we both focus and hover for radio buttons .
90
91
move-cursor-to: "#theme-dark"
91
92
focus: "#theme-dark"
92
93
assert-css: (
@@ -106,6 +107,80 @@ assert-css: (
106
107
},
107
108
)
108
109
110
+ // First we check the "default" display for toggles.
111
+ assert-css: (
112
+ "#auto-hide-large-items",
113
+ {
114
+ "background-color": "rgb(33, 150, 243)",
115
+ "border-color": "rgb(221, 221, 221)",
116
+ },
117
+ )
118
+ assert-css: (
119
+ "#use-system-theme",
120
+ {
121
+ "background-color": "rgba(0, 0, 0, 0)",
122
+ "border-color": "rgb(221, 221, 221)",
123
+ }
124
+ )
125
+ // Let's start with the hover for toggles.
126
+ move-cursor-to: "#auto-hide-large-items"
127
+ assert-css: (
128
+ "#auto-hide-large-items",
129
+ {
130
+ "background-color": "rgb(33, 150, 243)",
131
+ "border-color": "rgb(33, 150, 243)",
132
+ },
133
+ )
134
+ move-cursor-to: "#use-system-theme"
135
+ assert-css: (
136
+ "#use-system-theme",
137
+ {
138
+ "background-color": "rgba(0, 0, 0, 0)",
139
+ "border-color": "rgb(33, 150, 243)",
140
+ }
141
+ )
142
+ move-cursor-to: "#settings-menu > a"
143
+ // Let's now check with the focus for toggles.
144
+ focus: "#auto-hide-large-items"
145
+ assert-css: (
146
+ "#auto-hide-large-items",
147
+ {
148
+ "background-color": "rgb(33, 150, 243)",
149
+ "border-color": "rgb(221, 221, 221)",
150
+ "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
151
+ },
152
+ )
153
+ focus: "#use-system-theme"
154
+ assert-css: (
155
+ "#use-system-theme",
156
+ {
157
+ "background-color": "rgba(0, 0, 0, 0)",
158
+ "border-color": "rgb(221, 221, 221)",
159
+ "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
160
+ },
161
+ )
162
+ // Now we check we both focus and hover for toggles.
163
+ move-cursor-to: "#auto-hide-large-items"
164
+ focus: "#auto-hide-large-items"
165
+ assert-css: (
166
+ "#auto-hide-large-items",
167
+ {
168
+ "background-color": "rgb(33, 150, 243)",
169
+ "border-color": "rgb(33, 150, 243)",
170
+ "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
171
+ },
172
+ )
173
+ move-cursor-to: "#use-system-theme"
174
+ focus: "#use-system-theme"
175
+ assert-css: (
176
+ "#use-system-theme",
177
+ {
178
+ "background-color": "rgba(0, 0, 0, 0)",
179
+ "border-color": "rgb(33, 150, 243)",
180
+ "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
181
+ },
182
+ )
183
+
109
184
// We now switch the display.
110
185
click: "#use-system-theme"
111
186
// Wait for the hidden element to show up.
@@ -118,7 +193,7 @@ assert: ".setting-line.hidden #theme"
118
193
assert-text: ("#preferred-dark-theme .setting-name", "Preferred dark theme")
119
194
assert-text: ("#preferred-light-theme .setting-name", "Preferred light theme")
120
195
121
- // We now check that clicking on the "sliders" ' text is like clicking on the slider .
196
+ // We now check that clicking on the toggles ' text is like clicking on the checkbox .
122
197
// To test it, we use the "Disable keyboard shortcuts".
123
198
local-storage: {"rustdoc-disable-shortcuts": "false"}
124
199
click: ".setting-line:last-child .toggle .label"
@@ -141,10 +216,7 @@ assert-css: ("#settings-menu .popover", {"display": "none"})
141
216
// Now we go to the settings page to check that the CSS is loaded as expected.
142
217
goto: "file://" + |DOC_PATH| + "/settings.html"
143
218
wait-for: "#settings"
144
- assert-css: (
145
- ".setting-line .toggle .slider",
146
- {"width": "45px", "margin-right": "20px", "border": "0px none rgb(0, 0, 0)"},
147
- )
219
+ assert-css: (".setting-line", {"position": "relative"})
148
220
149
221
assert-attribute-false: ("#settings", {"class": "popover"}, CONTAINS)
150
222
compare-elements-position: (".sub form", "#settings", ("x"))
@@ -162,4 +234,4 @@ reload:
162
234
size: (300, 1000)
163
235
click: "#settings-menu"
164
236
wait-for: "#settings"
165
- assert-css: ("#settings .slider ", {"width ": "45px"}, ALL )
237
+ assert-css: (".setting-line ", {"position ": "relative"} )
0 commit comments