Tests for routes that resolve to class and factory components
This commit is contained in:
parent
9e65e6bf47
commit
f4fb5ac4be
1 changed files with 34 additions and 1 deletions
|
|
@ -51,7 +51,7 @@ o.spec("route", function() {
|
|||
o(root.firstChild.nodeName).equals("DIV")
|
||||
})
|
||||
|
||||
o("routed mount points can redraw synchronously (#1275)", function() {
|
||||
o("routed mount points can redraw synchronously (POJO component)", function() {
|
||||
var view = o.spy()
|
||||
|
||||
$window.location.href = prefix + "/"
|
||||
|
|
@ -65,6 +65,39 @@ o.spec("route", function() {
|
|||
|
||||
})
|
||||
|
||||
o("routed mount points can redraw synchronously (constructible component)", function() {
|
||||
var view = o.spy()
|
||||
|
||||
var Cmp = function(){}
|
||||
Cmp.prototype.view = view
|
||||
|
||||
$window.location.href = prefix + "/"
|
||||
route(root, "/", {"/":Cmp})
|
||||
|
||||
o(view.callCount).equals(1)
|
||||
|
||||
redrawService.redraw()
|
||||
|
||||
o(view.callCount).equals(2)
|
||||
|
||||
})
|
||||
|
||||
o("routed mount points can redraw synchronously (factory component)", function() {
|
||||
var view = o.spy()
|
||||
|
||||
function Cmp() {return {view: view}}
|
||||
|
||||
$window.location.href = prefix + "/"
|
||||
route(root, "/", {"/":Cmp})
|
||||
|
||||
o(view.callCount).equals(1)
|
||||
|
||||
redrawService.redraw()
|
||||
|
||||
o(view.callCount).equals(2)
|
||||
|
||||
})
|
||||
|
||||
o("default route doesn't break back button", function(done) {
|
||||
$window.location.href = "http://old.com"
|
||||
$window.location.href = "http://new.com"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue