diff options
Diffstat (limited to 'src/fauxton/test/core/paginateSpec.js')
-rw-r--r-- | src/fauxton/test/core/paginateSpec.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/fauxton/test/core/paginateSpec.js b/src/fauxton/test/core/paginateSpec.js index 413924856..981380e27 100644 --- a/src/fauxton/test/core/paginateSpec.js +++ b/src/fauxton/test/core/paginateSpec.js @@ -55,6 +55,10 @@ define([ }); describe('#next', function () { + beforeEach(function () { + //do this so it doesn't throw an error on other unwired up components + FauxtonAPI.triggerRouteEvent = function () {}; + }); it('Should navigate', function () { var navigateMock = sinon.spy(FauxtonAPI, 'navigate'); @@ -65,6 +69,15 @@ define([ FauxtonAPI.navigate.restore(); }); + it('Should trigger routeEvent', function () { + var navigateMock = sinon.spy(FauxtonAPI, 'triggerRouteEvent'); + + paginate.$('a#next').click(); + + assert.ok(navigateMock.calledOnce); + FauxtonAPI.triggerRouteEvent.restore(); + }); + }); @@ -79,6 +92,14 @@ define([ FauxtonAPI.navigate.restore(); }); + it('Should trigger routeEvent', function () { + var navigateMock = sinon.spy(FauxtonAPI, 'triggerRouteEvent'); + + paginate.$('a#previous').click(); + + assert.ok(navigateMock.calledOnce); + FauxtonAPI.triggerRouteEvent.restore(); + }); }); |