Skip to content

Commit 13e3f3a

Browse files
committed
Fix timeout test
1 parent 4f4b04b commit 13e3f3a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/unit/pjax.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,7 @@ if ($.support.pjax) {
796796
})
797797
})
798798

799+
// Test is fragile
799800
asyncTest("no initial pjax:popstate event", function() {
800801
var frame = this.frame
801802
var count = 0;
@@ -812,12 +813,15 @@ if ($.support.pjax) {
812813
} else if (count == 3) {
813814
equal(frame.location.pathname, "/env.html")
814815
frame.history.back()
816+
setTimeout(function() { window.iframeLoad(frame) }, 1000)
815817
} else if (count == 4) {
816818
equal(frame.location.pathname, "/hello.html")
817819
frame.history.back()
820+
setTimeout(function() { window.iframeLoad(frame) }, 1000)
818821
} else if (count == 5) {
819822
equal(frame.location.pathname, "/home.html")
820823
frame.history.forward()
824+
setTimeout(function() { window.iframeLoad(frame) }, 1000)
821825
} else if (count == 6) {
822826
// Should skip pjax:popstate since theres no initial pjax.state
823827
frame.$('#main').on('pjax:popstate', function(event) {
@@ -834,8 +838,9 @@ if ($.support.pjax) {
834838
if (count == 6) {
835839
count++
836840
frame.history.forward()
841+
setTimeout(function() { window.iframeLoad(frame) }, 1000)
837842
} else {
838-
start()
843+
setTimeout(function() { start() }, 1000)
839844
}
840845
})
841846
}

0 commit comments

Comments
 (0)