Added tests for other kinds of string
This commit is contained in:
parent
9ae6d0ede1
commit
e94a0a7c22
2 changed files with 33 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue