2
2
javascript: false
3
3
goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
4
4
// Since the javascript is disabled, there shouldn't be a toggle.
5
- assert-false: "#sidebar-toggle"
5
+ assert-false: "#src- sidebar-toggle"
6
6
wait-for-css: (".sidebar", {"display": "none"})
7
7
8
8
// Let's retry with javascript enabled.
9
9
javascript: true
10
10
reload:
11
- wait-for: "#sidebar-toggle"
12
- assert-css: ("#sidebar-toggle", {"visibility": "visible"})
13
- assert-css: (".sidebar > *:not(#sidebar-toggle)", {"visibility": "hidden"})
11
+ wait-for: "#src- sidebar-toggle"
12
+ assert-css: ("#src- sidebar-toggle", {"visibility": "visible"})
13
+ assert-css: (".sidebar > *:not(#src- sidebar-toggle)", {"visibility": "hidden"})
14
14
// Let's expand the sidebar now.
15
- click: "#sidebar-toggle"
16
- wait-for-css: ("#sidebar-toggle", {"visibility": "visible"})
15
+ click: "#src- sidebar-toggle"
16
+ wait-for-css: ("#src- sidebar-toggle", {"visibility": "visible"})
17
17
18
18
// We now check that opening the sidebar and clicking a link will leave it open.
19
19
// The behavior here on desktop is different than the behavior on mobile,
@@ -38,25 +38,25 @@ define-function: (
38
38
[
39
39
("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
40
40
("reload"),
41
- ("wait-for-css", ("#sidebar-toggle", {"visibility": "visible"})),
41
+ ("wait-for-css", ("#src- sidebar-toggle", {"visibility": "visible"})),
42
42
("assert-css", (
43
43
"#source-sidebar details[open] > .files a.selected",
44
44
{"color": |color_hover|, "background-color": |background|},
45
45
)),
46
46
47
47
// Without hover or focus.
48
- ("assert-css", ("#sidebar-toggle > button", {"background-color": |background_toggle|})),
48
+ ("assert-css", ("#src- sidebar-toggle > button", {"background-color": |background_toggle|})),
49
49
// With focus.
50
- ("focus", "#sidebar-toggle > button"),
50
+ ("focus", "#src- sidebar-toggle > button"),
51
51
("assert-css", (
52
- "#sidebar-toggle > button:focus",
52
+ "#src- sidebar-toggle > button:focus",
53
53
{"background-color": |background_toggle_hover|},
54
54
)),
55
55
("focus", ".search-input"),
56
56
// With hover.
57
- ("move-cursor-to", "#sidebar-toggle > button"),
57
+ ("move-cursor-to", "#src- sidebar-toggle > button"),
58
58
("assert-css", (
59
- "#sidebar-toggle > button:hover",
59
+ "#src- sidebar-toggle > button:hover",
60
60
{"background-color": |background_toggle_hover|},
61
61
)),
62
62
@@ -151,16 +151,16 @@ call-function: ("check-colors", {
151
151
size: (500, 700)
152
152
reload:
153
153
// Waiting for the sidebar to be displayed...
154
- wait-for-css: ("#sidebar-toggle", {"visibility": "visible"})
154
+ wait-for-css: ("#src- sidebar-toggle", {"visibility": "visible"})
155
155
156
156
// We now check it takes the full size of the display.
157
157
assert-property: ("body", {"clientWidth": "500", "clientHeight": "700"})
158
158
assert-property: (".sidebar", {"clientWidth": "500", "clientHeight": "700"})
159
159
160
160
// We now check the display of the toggle once the sidebar is expanded.
161
- assert-property: ("#sidebar-toggle", {"clientWidth": "500", "clientHeight": "39"})
161
+ assert-property: ("#src- sidebar-toggle", {"clientWidth": "500", "clientHeight": "39"})
162
162
assert-css: (
163
- "#sidebar-toggle",
163
+ "#src- sidebar-toggle",
164
164
{
165
165
"border-top-width": "0px",
166
166
"border-right-width": "0px",
@@ -170,36 +170,36 @@ assert-css: (
170
170
)
171
171
172
172
// We now check that the scroll position is kept when opening the sidebar.
173
- click: "#sidebar-toggle"
173
+ click: "#src- sidebar-toggle"
174
174
wait-for-css: (".sidebar", {"width": "0px"})
175
175
// We scroll to line 117 to change the scroll position.
176
176
scroll-to: '//*[@id="117"]'
177
177
assert-window-property: {"pageYOffset": "2542"}
178
178
// Expanding the sidebar...
179
- click: "#sidebar-toggle"
179
+ click: "#src- sidebar-toggle"
180
180
wait-for-css: (".sidebar", {"width": "500px"})
181
- click: "#sidebar-toggle"
181
+ click: "#src- sidebar-toggle"
182
182
wait-for-css: (".sidebar", {"width": "0px"})
183
183
// The "scrollTop" property should be the same.
184
184
assert-window-property: {"pageYOffset": "2542"}
185
185
186
186
// We now check that the scroll position is restored if the window is resized.
187
187
size: (500, 700)
188
- click: "#sidebar-toggle"
188
+ click: "#src- sidebar-toggle"
189
189
wait-for-css: ("#source-sidebar", {"visibility": "visible"})
190
190
assert-window-property: {"pageYOffset": "0"}
191
191
size: (900, 900)
192
192
assert-window-property: {"pageYOffset": "2542"}
193
193
size: (500, 700)
194
- click: "#sidebar-toggle"
194
+ click: "#src- sidebar-toggle"
195
195
wait-for-css: ("#source-sidebar", {"visibility": "hidden"})
196
196
197
197
// We now check that opening the sidebar and clicking a link will close it.
198
198
// The behavior here on mobile is different than the behavior on desktop,
199
199
// but common sense dictates that if you have a list of files that fills the entire screen, and
200
200
// you click one of them, you probably want to actually see the file's contents, and not just
201
201
// make it the current selection.
202
- click: "#sidebar-toggle"
202
+ click: "#src- sidebar-toggle"
203
203
wait-for-css: ("#source-sidebar", {"visibility": "visible"})
204
204
assert-local-storage: {"rustdoc-source-sidebar-show": "true"}
205
205
click: ".sidebar a.selected"
@@ -210,6 +210,6 @@ assert-local-storage: {"rustdoc-source-sidebar-show": "false"}
210
210
size: (1000, 1000)
211
211
wait-for-css: ("#source-sidebar", {"visibility": "hidden"})
212
212
assert-local-storage: {"rustdoc-source-sidebar-show": "false"}
213
- click: "#sidebar-toggle"
213
+ click: "#src- sidebar-toggle"
214
214
wait-for-css: ("#source-sidebar", {"visibility": "visible"})
215
215
assert-local-storage: {"rustdoc-source-sidebar-show": "true"}
0 commit comments