fix m.route when called from constructor
This commit is contained in:
parent
cf3b77c161
commit
8b952ee5ea
2 changed files with 34 additions and 4 deletions
|
|
@ -1570,6 +1570,28 @@ function testMithril(mock) {
|
|||
})
|
||||
return value == "foo+bar"
|
||||
})
|
||||
test(function() {
|
||||
mock.requestAnimationFrame.$resolve()
|
||||
mock.location.search = "?"
|
||||
|
||||
var root = mock.document.createElement("div")
|
||||
|
||||
var a = {}
|
||||
a.controller = function() {m.route("/b")}
|
||||
a.view = function() {return "a"}
|
||||
|
||||
var b = {}
|
||||
b.controller = function() {}
|
||||
b.view = function(ctrl) {return "b"}
|
||||
|
||||
m.route(root, "/a", {
|
||||
"/a": a,
|
||||
"/b": b
|
||||
})
|
||||
mock.requestAnimationFrame.$resolve()
|
||||
|
||||
return root.childNodes[0].nodeValue == "b"
|
||||
})
|
||||
//end m.route
|
||||
|
||||
//m.prop
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue