Skip to content

Commit 6f3fb00

Browse files
committed
updating unit test
1 parent 204635f commit 6f3fb00

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

packages/auth/src/core/auth/auth_impl.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
FAKE_APP_CHECK_CONTROLLER_PROVIDER,
2929
FAKE_HEARTBEAT_CONTROLLER,
3030
FAKE_HEARTBEAT_CONTROLLER_PROVIDER,
31+
regionalTestAuth,
3132
testAuth,
3233
testUser
3334
} from '../../../test/helpers/mock_auth';
@@ -309,14 +310,15 @@ describe('core/auth/auth_impl', () => {
309310
expect(auth.currentUser).to.be.null;
310311
});
311312
it('sets currentUser to null, calls remove', async () => {
313+
const regionalAuth = await regionalTestAuth();
312314
const token: FirebaseToken = {
313315
token: 'test-token',
314316
expirationTime: 123456789
315317
};
316-
await auth._updateFirebaseToken(token);
317-
await auth.signOut();
318+
await regionalAuth._updateFirebaseToken(token);
319+
await regionalAuth.signOut();
318320
expect(persistenceStub._remove).to.have.been.called;
319-
expect(auth.firebaseToken).to.be.null;
321+
expect(regionalAuth.firebaseToken).to.be.null;
320322
});
321323
it('is blocked if a beforeAuthStateChanged callback throws', async () => {
322324
await auth._updateCurrentUser(testUser(auth, 'test'));

packages/auth/src/core/auth/auth_impl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,9 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
489489
if (this.redirectPersistenceManager || this._popupRedirectResolver) {
490490
await this._setRedirectUser(null);
491491
}
492-
493-
// Clear Firebase token for Regional Auth Instance when signOut is called
494-
await this._updateFirebaseToken(null);
492+
if (this.tenantConfig) {
493+
await this._updateFirebaseToken(null);
494+
}
495495
// Prevent callbacks from being called again in _updateCurrentUser, as
496496
// they were already called in the first line.
497497
return this._updateCurrentUser(null, /* skipBeforeStateCallbacks */ true);

0 commit comments

Comments
 (0)