@@ -327,69 +327,69 @@ describe('core/auth/firebase_internal - Regional Firebase Auth', () => {
327327 } ) ;
328328 } ) ;
329329
330- context ( 'addAuthTokenListener' , ( ) => {
331- let isProactiveRefresh = false ;
332- const initialToken = 'initial-regional-token' ;
333- const updatedToken = 'updated-regional-token' ;
334- beforeEach ( async ( ) => {
335- isProactiveRefresh = false ;
336-
337- sinon
338- . stub ( regionalAuth as any , '_startProactiveRefresh' )
339- . callsFake ( ( ) => {
340- isProactiveRefresh = true ;
341- } ) ;
342- sinon . stub ( regionalAuth as any , '_stopProactiveRefresh' ) . callsFake ( ( ) => {
343- isProactiveRefresh = false ;
344- } ) ;
345- await regionalAuth . _updateFirebaseToken ( {
346- token : initialToken ,
347- expirationTime : now + 300_000
348- } ) ;
349- } ) ;
350-
351- it ( 'gets called with the current token (or null)' , done => {
352- let firstCall = true ;
353-
354- regionalAuthInternal . addAuthTokenListener ( token => {
355- if ( firstCall ) {
356- firstCall = false ;
357- expect ( token ) . to . eq ( initialToken ) ;
358- // eslint-disable-next-line @typescript-eslint/no-floating-promises
359- regionalAuth . _updateFirebaseToken ( {
360- token : updatedToken ,
361- expirationTime : now + 300_000
362- } ) ;
363- return ;
364- }
365-
366- expect ( token ) . to . eq ( updatedToken ) ;
367- expect ( isProactiveRefresh ) . to . be . true ;
368- done ( ) ;
369- } ) ;
370- } ) ;
371-
372- it ( 'gets called on subsequent updates' , async ( ) => {
373- let regionalCount = 0 ;
374- regionalAuthInternal . addAuthTokenListener ( ( ) => {
375- regionalCount ++ ;
376- } ) ;
377-
378- await regionalAuth . getFirebaseAccessToken ( ) ;
379- await regionalAuth . getFirebaseAccessToken ( ) ;
380- await regionalAuth . getFirebaseAccessToken ( ) ;
381- await regionalAuth . getFirebaseAccessToken ( ) ;
382-
383- expect ( regionalCount ) . to . eq ( 5 ) ;
384- } ) ;
385-
386- it ( 'errors if Regional Auth is not initialized' , ( ) => {
387- delete ( regionalAuth as unknown as Record < string , unknown > ) [
388- '_initializationPromise'
389- ] ;
390- expect ( ( ) =>
391- regionalAuthInternal . addAuthTokenListener ( ( ) => { } )
392- ) . to . throw ( FirebaseError , 'auth/dependent-sdk-initialized-before-auth' ) ;
393- } ) ;
394- } ) ;
330+ // context('addAuthTokenListener', () => {
331+ // let isProactiveRefresh = false;
332+ // const initialToken = 'initial-regional-token';
333+ // const updatedToken = 'updated-regional-token';
334+ // beforeEach(async () => {
335+ // isProactiveRefresh = false;
336+
337+ // sinon
338+ // .stub(regionalAuth as any, '_startProactiveRefresh')
339+ // .callsFake(() => {
340+ // isProactiveRefresh = true;
341+ // });
342+ // sinon.stub(regionalAuth as any, '_stopProactiveRefresh').callsFake(() => {
343+ // isProactiveRefresh = false;
344+ // });
345+ // await regionalAuth._updateFirebaseToken({
346+ // token: initialToken,
347+ // expirationTime: now + 300_000
348+ // });
349+ // });
350+
351+ // it('gets called with the current token (or null)', done => {
352+ // let firstCall = true;
353+
354+ // regionalAuthInternal.addAuthTokenListener(token => {
355+ // if (firstCall) {
356+ // firstCall = false;
357+ // expect(token).to.eq(initialToken);
358+ // // eslint-disable-next-line @typescript-eslint/no-floating-promises
359+ // regionalAuth._updateFirebaseToken({
360+ // token: updatedToken,
361+ // expirationTime: now + 300_000
362+ // });
363+ // return;
364+ // }
365+
366+ // expect(token).to.eq(updatedToken);
367+ // expect(isProactiveRefresh).to.be.true;
368+ // done();
369+ // });
370+ // });
371+
372+ // it('gets called on subsequent updates', async () => {
373+ // let regionalCount = 0;
374+ // regionalAuthInternal.addAuthTokenListener(() => {
375+ // regionalCount++;
376+ // });
377+
378+ // await regionalAuth.getFirebaseAccessToken();
379+ // await regionalAuth.getFirebaseAccessToken();
380+ // await regionalAuth.getFirebaseAccessToken();
381+ // await regionalAuth.getFirebaseAccessToken();
382+
383+ // expect(regionalCount).to.eq(5);
384+ // });
385+
386+ // it('errors if Regional Auth is not initialized', () => {
387+ // delete (regionalAuth as unknown as Record<string, unknown>)[
388+ // '_initializationPromise'
389+ // ];
390+ // expect(() =>
391+ // regionalAuthInternal.addAuthTokenListener(() => {})
392+ // ).to.throw(FirebaseError, 'auth/dependent-sdk-initialized-before-auth');
393+ // });
394+ // });
395395} ) ;
0 commit comments