1
0
mirror of https://github.com/fluencelabs/wasm-bindgen synced 2025-06-19 16:01:23 +00:00

Fix web-sys history unit test ()

In an actual browser, the changing of the history using the binding
worked a little too well, and caused the test to fail if you refreshed
the page or manually used the back and forward buttons.  The stateful
stuff has been removed - the remaining two assertions should adequately
test that the binding works, which is the point of these tests anyways.
This commit is contained in:
Tyler Wilcock
2018-07-31 08:55:30 -05:00
committed by Alex Crichton
parent 33e5223dd6
commit 05f3eec76d

@ -11,18 +11,6 @@ extern {
#[wasm_bindgen_test]
fn history() {
HISTORY.push_state(
Object::new().into(),
"I am a title",
Some("part/of/some/url"),
).unwrap();
assert_eq!(HISTORY.length().unwrap(), 2);
assert!(HISTORY.go(1).is_ok());
assert!(HISTORY.back().is_ok());
assert!(HISTORY.forward().is_ok());
assert!(HISTORY.go(-1).is_ok());
HISTORY.set_scroll_restoration(ScrollRestoration::Manual).expect("failure to set scroll restoration");
assert_eq!(HISTORY.scroll_restoration().unwrap(), ScrollRestoration::Manual);