@@ -96,7 +96,7 @@ describe('AutoRefreshTokenService', () => {
9696
9797 it ( 'should login if user is inactive and inactivity timeout is set to "login"' , async ( ) => {
9898 service [ 'options' ] . onInactivityTimeout = 'login' ;
99- service [ 'options' ] . logoutOptions = { redirectUri : 'testLoginUri' } ;
99+ service [ 'options' ] . loginOptions = { redirectUri : 'testLoginUri' } ;
100100 mockKeycloak . authenticated = true ;
101101 mockUserActivityService . isActive . and . returnValue ( false ) ;
102102 mockKeycloak . login . and . returnValue ( Promise . resolve ( ) ) ;
@@ -135,7 +135,7 @@ describe('AutoRefreshTokenService', () => {
135135 } ) ;
136136
137137 describe ( 'effect for KeycloakSignal' , ( ) => {
138- it ( 'should call processTokenExpiredEvent when a TokenExpired event is received' , async ( ) => {
138+ it ( 'should call processTokenExpiredEvent when a TokenExpired event is received' , ( done ) => {
139139 const processTokenExpiredSpy = spyOn (
140140 service as unknown as { processTokenExpiredEvent : ( ) => void } ,
141141 'processTokenExpiredEvent'
@@ -145,14 +145,10 @@ describe('AutoRefreshTokenService', () => {
145145 type : KeycloakEventType . TokenExpired
146146 } ) ) ;
147147
148- const keycloakEvent = mockKeycloakSignal ( ) ;
149- if ( keycloakEvent . type === KeycloakEventType . TokenExpired ) {
150- service [ 'processTokenExpiredEvent' ] ( ) ;
151- }
152-
153- await new Promise ( ( resolve ) => setTimeout ( resolve , 0 ) ) ;
148+ TestBed . tick ( ) ;
154149
155150 expect ( processTokenExpiredSpy ) . toHaveBeenCalled ( ) ;
151+ done ( ) ;
156152 } ) ;
157153 } ) ;
158154} ) ;
0 commit comments