diff --git a/tests/mithril-tests.js b/tests/mithril-tests.js index 2b571de1..b7b4d1bf 100644 --- a/tests/mithril-tests.js +++ b/tests/mithril-tests.js @@ -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