Rollup merge of #118988 - notriddle:notriddle/varconst, r=GuillaumeGomez

rustdoc: add regression test for JS data file loading

Follow up for #118961
This commit is contained in:
Matthias Krüger 2023-12-15 20:19:56 +01:00 committed by GitHub
commit 5fc9ff5619
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,24 @@
// Make sure search stores its data in `window`
// It needs to use a global to avoid racing on search-index.js and search.js
// https://github.com/rust-lang/rust/pull/118961
// URL query
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=sa'%3Bda'%3Bds"
wait-for: "#search-tabs"
assert-window-property-false: {"searchIndex": null}
assert-window-property: {"srcIndex": null}
// Form input
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "Foo")
press-key: 'Enter'
wait-for: "#search-tabs"
assert-window-property-false: {"searchIndex": null}
assert-window-property: {"srcIndex": null}
// source sidebar
go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
click: "#src-sidebar-toggle"
wait-for: "#src-sidebar details"
assert-window-property-false: {"srcIndex": null}
assert-window-property: {"searchIndex": null}