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) {
|
||||
var rendered = false
|
||||
var resolved
|
||||
$window.location.href = prefix + "/a"
|
||||
route(root, "/a", {
|
||||
"/a": {
|
||||
onmatch: function() {
|
||||
return Promise.resolve(function(resolve) {
|
||||
setTimeout(resolve, 0)
|
||||
return new Promise(function(resolve) {
|
||||
callAsync(function() {
|
||||
callAsync(function() {
|
||||
resolve({view: function() {}})
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
render: function(vnode) {
|
||||
rendered = true
|
||||
resolved = "a"
|
||||
}
|
||||
},
|
||||
|
|
@ -662,11 +668,12 @@ o.spec("route", function() {
|
|||
|
||||
route.set("/b")
|
||||
|
||||
setTimeout(function() {
|
||||
callAsync(function() {
|
||||
o(rendered).equals(false)
|
||||
o(resolved).equals("b")
|
||||
|
||||
done()
|
||||
}, 2) //FIXME magic number
|
||||
})
|
||||
})
|
||||
|
||||
o("route changes activate onbeforeremove", function(done) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue