Added tests for other kinds of string

This commit is contained in:
Richard Eames 2014-09-18 10:53:16 -06:00
parent 9ae6d0ede1
commit e94a0a7c22
2 changed files with 33 additions and 2 deletions

View file

@ -1495,6 +1495,36 @@ function testMithril(mock) {
})
return value == "foo+bar"
})
test(function() {
mock.requestAnimationFrame.$resolve() //setup
mock.location.search = "?"
var root = mock.document.createElement("div")
m.route.mode = "search"
m.route(root, "/", {
"/": {controller: function() {}, view: function() {return "foo"}},
"/test22": {controller: function() {}, view: function() {return "bar"}}
})
mock.requestAnimationFrame.$resolve()
m.route(String("/test22/"))
mock.requestAnimationFrame.$resolve() //teardown
return mock.location.search == "?/test22/" && root.childNodes[0].nodeValue === "bar"
})
test(function() {
mock.requestAnimationFrame.$resolve() //setup
mock.location.search = "?"
var root = mock.document.createElement("div")
m.route.mode = "search"
m.route(root, "/", {
"/": {controller: function() {}, view: function() {return "foo"}},
"/test23": {controller: function() {}, view: function() {return "bar"}}
})
mock.requestAnimationFrame.$resolve()
m.route(new String("/test23/"))
mock.requestAnimationFrame.$resolve() //teardown
return mock.location.search == "?/test23/" && root.childNodes[0].nodeValue === "bar"
})
//end m.route
//m.prop