Skip to content

Commit 6bbbff5

Browse files
committed
rustdoc: add regression test for JS data file loading
Follow up for #118961
1 parent 09c8fd3 commit 6bbbff5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/rustdoc-gui/globals.goml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Make sure search stores its data in `window`
2+
// It needs to use a global to avoid racing on search-index.js and search.js
3+
// https://github.com/rust-lang/rust/pull/118961
4+
5+
// URL query
6+
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=sa'%3Bda'%3Bds"
7+
wait-for: "#search-tabs"
8+
assert-window-property-false: {"searchIndex": null}
9+
assert-window-property: {"srcIndex": null}
10+
11+
// Form input
12+
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
13+
write: (".search-input", "Foo")
14+
press-key: 'Enter'
15+
wait-for: "#search-tabs"
16+
assert-window-property-false: {"searchIndex": null}
17+
assert-window-property: {"srcIndex": null}
18+
19+
// source sidebar
20+
go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
21+
click: "#src-sidebar-toggle"
22+
wait-for: "#src-sidebar details"
23+
assert-window-property-false: {"srcIndex": null}
24+
assert-window-property: {"searchIndex": null}

0 commit comments

Comments
 (0)