File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ describe('LoginComponent', () => {
17
17
} ,
18
18
signIn ( ) {
19
19
return of ( ) ;
20
+ } ,
21
+ setCookies ( ) {
20
22
}
21
23
} ;
22
24
@@ -56,6 +58,15 @@ describe('LoginComponent', () => {
56
58
expect ( azureAdB2CService . signIn ) . toHaveBeenCalled ( ) ;
57
59
} ) ) ;
58
60
61
+ it ( 'test line 20-2' , inject ( [ Router ] , ( router : Router ) => {
62
+ spyOn ( azureAdB2CService , 'isLogin' ) . and . returnValue ( false ) ;
63
+ spyOn ( azureAdB2CService , 'setCookies' ) . and . returnValue ( ) ;
64
+ spyOn ( azureAdB2CService , 'signIn' ) . and . returnValue ( of ( ( ) => { } ) ) ;
65
+ component . login ( ) ;
66
+ expect ( azureAdB2CService . signIn ) . toHaveBeenCalled ( ) ;
67
+ expect ( azureAdB2CService . setCookies ) . toHaveBeenCalled ( ) ;
68
+ } ) ) ;
69
+
59
70
it ( 'should not sign-up or login with google if is already logged-in into the app' , inject ( [ Router ] , ( router : Router ) => {
60
71
spyOn ( azureAdB2CService , 'isLogin' ) . and . returnValue ( true ) ;
61
72
spyOn ( router , 'navigate' ) . and . stub ( ) ;
You can’t perform that action at this time.
0 commit comments