Validate the DOM node passed to render
This commit is contained in:
parent
2c93e4995e
commit
b8673f2ff5
4 changed files with 30 additions and 0 deletions
|
|
@ -28,6 +28,16 @@ o.spec("route", function() {
|
|||
route.prefix(prefix)
|
||||
})
|
||||
|
||||
o("throws on invalid `root` DOM node", function() {
|
||||
var threw = false
|
||||
try {
|
||||
route(null, '/', {'/':{view: function() {}}})
|
||||
} catch (e) {
|
||||
threw = true
|
||||
}
|
||||
o(threw).equals(true)
|
||||
})
|
||||
|
||||
o("renders into `root`", function() {
|
||||
$window.location.href = prefix + "/"
|
||||
route(root, "/", {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue