@@ -15,91 +15,83 @@ describe('TcAuthService', function() {
15
15
expect ( service ) . to . exist ;
16
16
} ) ;
17
17
18
- describe ( " isAuthenticated" , function ( ) {
18
+ describe ( ' isAuthenticated - invalid v2 token' , function ( ) {
19
19
beforeEach ( function ( ) {
20
20
bard . mockService ( AuthTokenService , {
21
21
getV2Token : function ( ) {
22
- return
22
+ return ;
23
23
} ,
24
24
getV3Token : function ( ) {
25
- return " v3Token" ;
25
+ return ' v3Token' ;
26
26
} ,
27
+ getTCSSOToken : function ( ) {
28
+ return 'tcssoToken' ;
29
+ }
27
30
} ) ;
28
31
} ) ;
29
- it ( 'should return false for invalid v2token' , function ( ) {
32
+
33
+ it ( 'should return false' , function ( ) {
30
34
expect ( service . isAuthenticated ( ) ) . to . be . false ;
31
35
} ) ;
32
36
} ) ;
33
37
34
- describe ( " isAuthenticated" , function ( ) {
38
+ describe ( ' isAuthenticated - invalid v3 token' , function ( ) {
35
39
beforeEach ( function ( ) {
36
40
bard . mockService ( AuthTokenService , {
37
41
getV2Token : function ( ) {
38
- return " v2Token" ;
42
+ return ' v2Token' ;
39
43
} ,
40
44
getV3Token : function ( ) {
41
45
return ;
42
46
} ,
47
+ getTCSSOToken : function ( ) {
48
+ return 'tcssoToken' ;
49
+ }
43
50
} ) ;
44
51
} ) ;
45
- it ( 'should return false for invalid v3token' , function ( ) {
52
+
53
+ it ( 'should return false' , function ( ) {
46
54
expect ( service . isAuthenticated ( ) ) . to . be . false ;
47
55
} ) ;
48
56
} ) ;
49
57
50
- describe ( " isAuthenticated" , function ( ) {
58
+ describe ( ' isAuthenticated - invalid v2 tcsso token' , function ( ) {
51
59
beforeEach ( function ( ) {
52
60
bard . mockService ( AuthTokenService , {
53
61
getV2Token : function ( ) {
54
- return " v2Token" ;
62
+ return ' v2Token' ;
55
63
} ,
56
64
getV3Token : function ( ) {
57
- return "V3Token" ;
65
+ return 'v3Token' ;
58
66
} ,
67
+ getTCSSOToken : function ( ) {
68
+ return ;
69
+ }
59
70
} ) ;
60
71
} ) ;
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 ;
63
75
} ) ;
64
76
} ) ;
65
- describe ( "isAuthenticated" , function ( ) {
77
+
78
+ describe ( 'isAuthenticated - valid tokens' , function ( ) {
66
79
beforeEach ( function ( ) {
67
80
bard . mockService ( AuthTokenService , {
68
81
getV2Token : function ( ) {
69
- return ;
82
+ return 'v2Token' ;
70
83
} ,
71
84
getV3Token : function ( ) {
72
- return ;
85
+ return 'V3Token' ;
73
86
} ,
87
+ getTCSSOToken : function ( ) {
88
+ return 'tcssoToken' ;
89
+ }
74
90
} ) ;
75
91
} ) ;
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 ;
78
95
} ) ;
79
96
} ) ;
80
97
} ) ;
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