Skip to content

Commit 8791c90

Browse files
committed
History test
1 parent 826b6d4 commit 8791c90

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

lib/js/tests/Webapi/Dom/Webapi__Dom__History__test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
'use strict';
22

33

4+
var length = window.history.length;
5+
6+
var scrollRestorationTest = window.history.scrollRestoration;
7+
48
window.history.scrollRestoration = "auto";
59

610
window.history.scrollRestoration = "manual";
711

12+
var stateTest = window.history.state;
13+
814
var match = window.history.scrollRestoration;
915

1016
if (match === "manual") {
@@ -23,4 +29,7 @@ window.history.pushState(window.history.state, "My title", "http://...");
2329

2430
window.history.replaceState(window.history.state, "My title", "http://...");
2531

26-
/* Not a pure module */
32+
exports.length = length;
33+
exports.scrollRestorationTest = scrollRestorationTest;
34+
exports.stateTest = stateTest;
35+
/* length Not a pure module */

tests/Webapi/Dom/Webapi__Dom__History__test.res

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
open Webapi.Dom
22
open History
33

4-
let _ = history->length
5-
let _ = history->scrollRestoration
6-
let _ = history->setScrollRestoration(#auto)
7-
let _ = history->setScrollRestoration(#manual)
8-
let _ = history->state
4+
let length: int = history->length
5+
let scrollRestorationTest: [#auto | #manual] = history->scrollRestoration
6+
history->setScrollRestoration(#auto)
7+
history->setScrollRestoration(#manual)
8+
let stateTest: state = history->state
99

1010
switch (history->scrollRestoration) {
1111
| #auto => Js.log("auto scroll")

0 commit comments

Comments
 (0)