22javascript: false
33goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
44// Since the javascript is disabled, there shouldn't be a toggle.
5- assert-false: "#sidebar-toggle"
5+ assert-false: "#src- sidebar-toggle"
66wait-for-css: (".sidebar", {"display": "none"})
77
88// Let's retry with javascript enabled.
99javascript: true
1010reload:
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"})
1414// 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"})
1717
1818// We now check that opening the sidebar and clicking a link will leave it open.
1919// The behavior here on desktop is different than the behavior on mobile,
@@ -38,25 +38,25 @@ define-function: (
3838 [
3939 ("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
4040 ("reload"),
41- ("wait-for-css", ("#sidebar-toggle", {"visibility": "visible"})),
41+ ("wait-for-css", ("#src- sidebar-toggle", {"visibility": "visible"})),
4242 ("assert-css", (
4343 "#source-sidebar details[open] > .files a.selected",
4444 {"color": |color_hover|, "background-color": |background|},
4545 )),
4646
4747 // 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|})),
4949 // With focus.
50- ("focus", "#sidebar-toggle > button"),
50+ ("focus", "#src- sidebar-toggle > button"),
5151 ("assert-css", (
52- "#sidebar-toggle > button:focus",
52+ "#src- sidebar-toggle > button:focus",
5353 {"background-color": |background_toggle_hover|},
5454 )),
5555 ("focus", ".search-input"),
5656 // With hover.
57- ("move-cursor-to", "#sidebar-toggle > button"),
57+ ("move-cursor-to", "#src- sidebar-toggle > button"),
5858 ("assert-css", (
59- "#sidebar-toggle > button:hover",
59+ "#src- sidebar-toggle > button:hover",
6060 {"background-color": |background_toggle_hover|},
6161 )),
6262
@@ -151,16 +151,16 @@ call-function: ("check-colors", {
151151size: (500, 700)
152152reload:
153153// Waiting for the sidebar to be displayed...
154- wait-for-css: ("#sidebar-toggle", {"visibility": "visible"})
154+ wait-for-css: ("#src- sidebar-toggle", {"visibility": "visible"})
155155
156156// We now check it takes the full size of the display.
157157assert-property: ("body", {"clientWidth": "500", "clientHeight": "700"})
158158assert-property: (".sidebar", {"clientWidth": "500", "clientHeight": "700"})
159159
160160// 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"})
162162assert-css: (
163- "#sidebar-toggle",
163+ "#src- sidebar-toggle",
164164 {
165165 "border-top-width": "0px",
166166 "border-right-width": "0px",
@@ -170,36 +170,36 @@ assert-css: (
170170)
171171
172172// We now check that the scroll position is kept when opening the sidebar.
173- click: "#sidebar-toggle"
173+ click: "#src- sidebar-toggle"
174174wait-for-css: (".sidebar", {"width": "0px"})
175175// We scroll to line 117 to change the scroll position.
176176scroll-to: '//*[@id="117"]'
177177assert-window-property: {"pageYOffset": "2542"}
178178// Expanding the sidebar...
179- click: "#sidebar-toggle"
179+ click: "#src- sidebar-toggle"
180180wait-for-css: (".sidebar", {"width": "500px"})
181- click: "#sidebar-toggle"
181+ click: "#src- sidebar-toggle"
182182wait-for-css: (".sidebar", {"width": "0px"})
183183// The "scrollTop" property should be the same.
184184assert-window-property: {"pageYOffset": "2542"}
185185
186186// We now check that the scroll position is restored if the window is resized.
187187size: (500, 700)
188- click: "#sidebar-toggle"
188+ click: "#src- sidebar-toggle"
189189wait-for-css: ("#source-sidebar", {"visibility": "visible"})
190190assert-window-property: {"pageYOffset": "0"}
191191size: (900, 900)
192192assert-window-property: {"pageYOffset": "2542"}
193193size: (500, 700)
194- click: "#sidebar-toggle"
194+ click: "#src- sidebar-toggle"
195195wait-for-css: ("#source-sidebar", {"visibility": "hidden"})
196196
197197// We now check that opening the sidebar and clicking a link will close it.
198198// The behavior here on mobile is different than the behavior on desktop,
199199// but common sense dictates that if you have a list of files that fills the entire screen, and
200200// you click one of them, you probably want to actually see the file's contents, and not just
201201// make it the current selection.
202- click: "#sidebar-toggle"
202+ click: "#src- sidebar-toggle"
203203wait-for-css: ("#source-sidebar", {"visibility": "visible"})
204204assert-local-storage: {"rustdoc-source-sidebar-show": "true"}
205205click: ".sidebar a.selected"
@@ -210,6 +210,6 @@ assert-local-storage: {"rustdoc-source-sidebar-show": "false"}
210210size: (1000, 1000)
211211wait-for-css: ("#source-sidebar", {"visibility": "hidden"})
212212assert-local-storage: {"rustdoc-source-sidebar-show": "false"}
213- click: "#sidebar-toggle"
213+ click: "#src- sidebar-toggle"
214214wait-for-css: ("#source-sidebar", {"visibility": "visible"})
215215assert-local-storage: {"rustdoc-source-sidebar-show": "true"}
0 commit comments