@@ -43,12 +43,12 @@ wait-for: "#settings"
43
43
// We check that the "Use system theme" is disabled.
44
44
assert-property: ("#theme-system-preference", {"checked": "false"})
45
45
// Meaning that only the "theme" menu is showing up.
46
- assert: ".setting-line:not(.hidden) #theme "
47
- assert: ".setting-line.hidden #preferred-dark-theme"
48
- assert: ".setting-line.hidden #preferred-light-theme"
46
+ assert: "#theme .setting-line:not(.hidden)"
47
+ assert: "#preferred-dark-theme.setting-line.hidden "
48
+ assert: "#preferred-light-theme.setting-line.hidden "
49
49
50
50
// We check that the correct theme is selected.
51
- assert-property: ("#theme .choices #theme-dark", {"checked": "true"})
51
+ assert-property: ("#theme .setting-radio- choices #theme-dark", {"checked": "true"})
52
52
53
53
// Some style checks...
54
54
move-cursor-to: "#settings-menu > a"
@@ -109,31 +109,31 @@ assert-css: (
109
109
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
110
110
},
111
111
)
112
- // Now we check the setting-name for radio buttons is on a different line than the label.
112
+ // Now we check the setting-radio-name is on a different line than the label.
113
113
compare-elements-position-near: (
114
- "#theme .setting-name",
115
- "#theme .choices",
114
+ "#theme .setting-radio- name",
115
+ "#theme .setting-radio- choices",
116
116
{"x": 1}
117
117
)
118
118
compare-elements-position-near-false: (
119
- "#theme .setting-name",
120
- "#theme .choices",
119
+ "#theme .setting-radio- name",
120
+ "#theme .setting-radio- choices",
121
121
{"y": 1}
122
122
)
123
123
// Now we check that the label positions are all on the same line.
124
124
compare-elements-position-near: (
125
- "#theme .choices #theme-light",
126
- "#theme .choices #theme-dark",
125
+ "#theme .setting-radio- choices #theme-light",
126
+ "#theme .setting-radio- choices #theme-dark",
127
127
{"y": 1}
128
128
)
129
129
compare-elements-position-near: (
130
- "#theme .choices #theme-dark",
131
- "#theme .choices #theme-ayu",
130
+ "#theme .setting-radio- choices #theme-dark",
131
+ "#theme .setting-radio- choices #theme-ayu",
132
132
{"y": 1}
133
133
)
134
134
compare-elements-position-near: (
135
- "#theme .choices #theme-ayu",
136
- "#theme .choices #theme-system-preference",
135
+ "#theme .setting-radio- choices #theme-ayu",
136
+ "#theme .setting-radio- choices #theme-system-preference",
137
137
{"y": 1}
138
138
)
139
139
@@ -180,17 +180,17 @@ assert-css: (
180
180
// We now switch the display.
181
181
click: "#theme-system-preference"
182
182
// Wait for the hidden element to show up.
183
- wait-for: ".setting-line:not(.hidden) #preferred-dark-theme "
184
- assert: ".setting-line:not(.hidden) #preferred-light-theme "
183
+ wait-for: "#preferred-dark-theme .setting-line:not(.hidden)"
184
+ assert: "#preferred-light-theme .setting-line:not(.hidden)"
185
185
186
186
// We check their text as well.
187
- assert-text: ("#preferred-dark-theme .setting-name", "Preferred dark theme")
188
- assert-text: ("#preferred-light-theme .setting-name", "Preferred light theme")
187
+ assert-text: ("#preferred-dark-theme .setting-radio- name", "Preferred dark theme")
188
+ assert-text: ("#preferred-light-theme .setting-radio- name", "Preferred light theme")
189
189
190
190
// We now check that clicking on the toggles' text is like clicking on the checkbox.
191
191
// To test it, we use the "Disable keyboard shortcuts".
192
192
local-storage: {"rustdoc-disable-shortcuts": "false"}
193
- click: ".setting-line:last-child .settings-toggle .label "
193
+ click: ".setting-line:last-child .setting-check span "
194
194
assert-local-storage: {"rustdoc-disable-shortcuts": "true"}
195
195
196
196
// Make sure that "Disable keyboard shortcuts" actually took effect.
@@ -200,7 +200,7 @@ assert-false: "#help-button .popover"
200
200
wait-for-css: ("#settings-menu .popover", {"display": "block"})
201
201
202
202
// Now turn keyboard shortcuts back on, and see if they work.
203
- click: ".setting-line:last-child .settings-toggle .label "
203
+ click: ".setting-line:last-child .setting-check span "
204
204
assert-local-storage: {"rustdoc-disable-shortcuts": "false"}
205
205
press-key: "Escape"
206
206
press-key: "?"
0 commit comments