Add test case

This commit is contained in:
Toby Zerner 2015-04-22 07:31:59 +09:30
parent 46406095f2
commit 337ec325b3

View file

@ -3405,6 +3405,39 @@ function testMithril(mock) {
return initCount == 1
})
test(function() {
// https://github.com/lhorie/mithril.js/pull/571
mock.requestAnimationFrame.$resolve()
mock.location.search = "?"
var root = mock.document.createElement("div")
var a = {}
a.controller = function() {}
a.view = function() {
return m("div", {config: function(elm, init, ctx) {
elm.childNodes[0].modified = true
}}, m("div"))
}
var b = {}
b.controller = function() {}
b.view = function() {
return m("div", m("div"))
}
m.route(root, "/a", {
"/a": a,
"/b": b,
})
mock.requestAnimationFrame.$resolve()
m.route("/b")
mock.requestAnimationFrame.$resolve()
return !root.childNodes[0].childNodes[0].modified;
});
//end m.route
//m.route.parseQueryString