fix invalidation test
This commit is contained in:
parent
19729bccdf
commit
d8ad94adb2
1 changed files with 11 additions and 4 deletions
|
|
@ -640,16 +640,22 @@ o.spec("route", function() {
|
||||||
})
|
})
|
||||||
|
|
||||||
o("calling route.set invalidates pending onmatch resolution", function(done) {
|
o("calling route.set invalidates pending onmatch resolution", function(done) {
|
||||||
|
var rendered = false
|
||||||
var resolved
|
var resolved
|
||||||
$window.location.href = prefix + "/a"
|
$window.location.href = prefix + "/a"
|
||||||
route(root, "/a", {
|
route(root, "/a", {
|
||||||
"/a": {
|
"/a": {
|
||||||
onmatch: function() {
|
onmatch: function() {
|
||||||
return Promise.resolve(function(resolve) {
|
return new Promise(function(resolve) {
|
||||||
setTimeout(resolve, 0)
|
callAsync(function() {
|
||||||
|
callAsync(function() {
|
||||||
|
resolve({view: function() {}})
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
render: function(vnode) {
|
render: function(vnode) {
|
||||||
|
rendered = true
|
||||||
resolved = "a"
|
resolved = "a"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -662,11 +668,12 @@ o.spec("route", function() {
|
||||||
|
|
||||||
route.set("/b")
|
route.set("/b")
|
||||||
|
|
||||||
setTimeout(function() {
|
callAsync(function() {
|
||||||
|
o(rendered).equals(false)
|
||||||
o(resolved).equals("b")
|
o(resolved).equals("b")
|
||||||
|
|
||||||
done()
|
done()
|
||||||
}, 2) //FIXME magic number
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
o("route changes activate onbeforeremove", function(done) {
|
o("route changes activate onbeforeremove", function(done) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue