add integration test
This commit is contained in:
parent
2ffd2fb7e4
commit
a2b45ff131
2 changed files with 24 additions and 1 deletions
|
|
@ -609,6 +609,29 @@ o.spec("route", function() {
|
|||
}, 30)
|
||||
})
|
||||
|
||||
o("route changes activate onbeforeremove", function(done, timeout) {
|
||||
var spy = o.spy()
|
||||
|
||||
$window.location.href = prefix + "/a"
|
||||
route(root, "/a", {
|
||||
"/a": {
|
||||
onbeforeremove: spy,
|
||||
view: function() {}
|
||||
},
|
||||
"/b": {
|
||||
view: function() {}
|
||||
}
|
||||
})
|
||||
|
||||
route.set("/b")
|
||||
|
||||
setTimeout(function() {
|
||||
o(spy.callCount).equals(1)
|
||||
|
||||
done()
|
||||
}, 30)
|
||||
})
|
||||
|
||||
o("throttles", function(done, timeout) {
|
||||
timeout(200)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ o.spec("api", function() {
|
|||
var FRAME_BUDGET = Math.floor(1000 / 60)
|
||||
o.beforeEach(function() {
|
||||
var mock = browserMock()
|
||||
if (typeof global !== "undefined") global.window = mock, global.document = mock.document
|
||||
if (typeof global !== "undefined") global.window = mock
|
||||
m = require("../mithril")
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue