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

Commit f4a5e2f

Browse files
author
Parth Shah
committed
fixing a test
1 parent 6066f59 commit f4a5e2f

File tree

1 file changed

+34
-42
lines changed

1 file changed

+34
-42
lines changed

app/services/tcAuth.service.spec.js

Lines changed: 34 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,91 +15,83 @@ describe('TcAuthService', function() {
1515
expect(service).to.exist;
1616
});
1717

18-
describe("isAuthenticated", function() {
18+
describe('isAuthenticated - invalid v2 token', function() {
1919
beforeEach(function() {
2020
bard.mockService(AuthTokenService, {
2121
getV2Token: function() {
22-
return
22+
return;
2323
},
2424
getV3Token: function() {
25-
return "v3Token";
25+
return 'v3Token';
2626
},
27+
getTCSSOToken: function() {
28+
return 'tcssoToken';
29+
}
2730
});
2831
});
29-
it('should return false for invalid v2token', function() {
32+
33+
it('should return false', function() {
3034
expect(service.isAuthenticated()).to.be.false;
3135
});
3236
});
3337

34-
describe("isAuthenticated", function() {
38+
describe('isAuthenticated - invalid v3 token', function() {
3539
beforeEach(function() {
3640
bard.mockService(AuthTokenService, {
3741
getV2Token: function() {
38-
return "v2Token";
42+
return 'v2Token';
3943
},
4044
getV3Token: function() {
4145
return ;
4246
},
47+
getTCSSOToken: function() {
48+
return 'tcssoToken';
49+
}
4350
});
4451
});
45-
it('should return false for invalid v3token', function() {
52+
53+
it('should return false', function() {
4654
expect(service.isAuthenticated()).to.be.false;
4755
});
4856
});
4957

50-
describe("isAuthenticated", function() {
58+
describe('isAuthenticated - invalid v2 tcsso token', function() {
5159
beforeEach(function() {
5260
bard.mockService(AuthTokenService, {
5361
getV2Token: function() {
54-
return "v2Token";
62+
return 'v2Token';
5563
},
5664
getV3Token: function() {
57-
return "V3Token";
65+
return 'v3Token';
5866
},
67+
getTCSSOToken: function() {
68+
return;
69+
}
5970
});
6071
});
61-
it('should return true for valid tokens', function() {
62-
expect(service.isAuthenticated()).to.be.true;
72+
73+
it('should return false', function() {
74+
expect(service.isAuthenticated()).to.be.false;
6375
});
6476
});
65-
describe("isAuthenticated", function() {
77+
78+
describe('isAuthenticated - valid tokens', function() {
6679
beforeEach(function() {
6780
bard.mockService(AuthTokenService, {
6881
getV2Token: function() {
69-
return ;
82+
return 'v2Token';
7083
},
7184
getV3Token: function() {
72-
return ;
85+
return 'V3Token';
7386
},
87+
getTCSSOToken: function() {
88+
return 'tcssoToken';
89+
}
7490
});
7591
});
76-
it('should return false for invalid tokens', function() {
77-
expect(service.isAuthenticated()).to.be.false;
92+
93+
it('should return true', function() {
94+
expect(service.isAuthenticated()).to.be.true;
7895
});
7996
});
8097
});
81-
// describe.only('TCAuthService', function() {
82-
// beforeEach(function() {
83-
// var service;
84-
// bard.appModule('tc.services');
85-
// bard.inject(this, '$httpBackend', 'AuthTokenService', 'TcAuthService');
86-
// bard.mockService(AuthTokenService, {
87-
// getV2Token(): function() {return;},
88-
// getV3Token(): function() {return "v3token";}
89-
// });
90-
// service = TcAuthService;
91-
// $rootScope.$apply();
92-
// });
93-
94-
// // bard.verifyNoOutstandingHttpRequests();
95-
96-
// it('should exist', function() {
97-
// expect(service).to.exist;
98-
// });
99-
100-
// describe('isAuthenticated', function() {
101-
// it('should return false for invalid v3 token', function() {
102-
// expect(service.isAuthenticated()).to.be.false;
103-
// });
104-
// });
105-
// });

0 commit comments

Comments
 (0)