diff --git a/api/tests/test-router.js b/api/tests/test-router.js index 9b8705da..c624789b 100644 --- a/api/tests/test-router.js +++ b/api/tests/test-router.js @@ -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"