Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 5b062e8

Browse files
author
vikasrohit
committed
AS#153276200846788, Redirect loop for some users on production
-- Fixed unit tests
1 parent f711f75 commit 5b062e8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/services/jwtInterceptor.service.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ describe('JWT Interceptor Service', function() {
2727
fakeState = {
2828
go: sinon.spy(function(param) {
2929
return
30+
}),
31+
href: sinon.spy(function(stateName, toParams, params) {
32+
return 'https://topcoder.com/' + stateName
3033
})
3134
},
3235
fakeWindow = {
@@ -84,6 +87,7 @@ describe('JWT Interceptor Service', function() {
8487
expect($window.location).not.null
8588
expect($window.location).to.have.string(CONSTANTS.ACCOUNTS_APP_URL)
8689
expect(TcAuthService.isAuthenticated).to.be.have.been.calledOnce
90+
expect(fakeState.href).to.be.calledWith('dashboard')
8791
})
8892

8993
it('should redirect to login page for other endpoints', function() {
@@ -95,6 +99,7 @@ describe('JWT Interceptor Service', function() {
9599
expect($window.location).not.null
96100
expect($window.location).to.have.string(CONSTANTS.ACCOUNTS_APP_URL)
97101
expect(TcAuthService.isAuthenticated).to.be.have.been.calledOnce
102+
expect(fakeState.href).to.be.calledWith('dashboard')
98103
})
99104

100105
afterEach(function() {

0 commit comments

Comments
 (0)