File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -608,5 +608,16 @@ describe('Store config UID2', () => {
608608 identity : expiredIdentity2 ,
609609 } ) ;
610610 } ) ;
611+ test ( 'runs NoIdentityAvailable event' , ( ) => {
612+ uid2 . init ( { } ) ;
613+ let expiredIdentity = makeIdentity ( {
614+ identity_expires : Date . now ( ) - 5000 ,
615+ refresh_expires : Date . now ( ) - 5000 ,
616+ } ) ;
617+ uid2 . setIdentity ( expiredIdentity ) ;
618+ expect ( handler ) . toHaveBeenLastCalledWith ( EventType . NoIdentityAvailable , {
619+ identity : null ,
620+ } ) ;
621+ } ) ;
611622 } ) ;
612623} ) ;
Original file line number Diff line number Diff line change @@ -158,6 +158,8 @@ export abstract class SdkBase {
158158 this . triggerRefreshOrSetTimer ( validatedIdentity ) ;
159159 }
160160 this . _callbackManager . runCallbacks ( EventType . IdentityUpdated , { } ) ;
161+ } else {
162+ this . _callbackManager . runCallbacks ( EventType . NoIdentityAvailable , { } ) ;
161163 }
162164 }
163165
You can’t perform that action at this time.
0 commit comments