Skip to content

Commit 537ca75

Browse files
committed
Fix test issues
1 parent acfe824 commit 537ca75

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

packages-exp/auth-exp/src/platform_browser/messagechannel/sender.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ describe('platform_browser/messagechannel/sender', () => {
8989

9090
it('should timeout if it doesnt see an ACK', async () => {
9191
serviceWorker.addEventListener('message', (_event: Event) => {
92+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
9293
Promise.resolve().then(() => {
9394
pendingTimeouts[_TimeoutDuration.ACK]();
9495
});
@@ -110,6 +111,7 @@ describe('platform_browser/messagechannel/sender', () => {
110111
}
111112
];
112113
serviceWorker.addEventListener('message', (event: Event) => {
114+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
113115
Promise.resolve().then(() => {
114116
pendingTimeouts[_TimeoutDuration.ACK]();
115117
});

packages-exp/auth-exp/src/platform_browser/popup_redirect.test.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,8 @@ import {
4141
PopupRedirectResolver
4242
} from '../model/popup_redirect';
4343
import * as authWindow from './auth_window';
44-
import * as mockFetch from '../../test/helpers/mock_fetch';
4544
import * as gapiLoader from './iframe/gapi';
4645
import { browserPopupRedirectResolver } from './popup_redirect';
47-
import { mockEndpoint } from '../../test/helpers/api/helper';
48-
import { Endpoint } from '../api';
4946

5047
use(chaiAsPromised);
5148
use(sinonChai);
@@ -57,7 +54,6 @@ describe('platform_browser/popup_redirect', () => {
5754
let iframeSendStub: sinon.SinonStub;
5855

5956
beforeEach(async () => {
60-
mockFetch.setUp();
6157
auth = await testAuth();
6258
resolver = new (browserPopupRedirectResolver as SingletonInstantiator<
6359
PopupRedirectResolver
@@ -88,7 +84,6 @@ describe('platform_browser/popup_redirect', () => {
8884

8985
afterEach(() => {
9086
sinon.restore();
91-
mockFetch.tearDown();
9287
delete authWindow._window().gapi;
9388
});
9489

@@ -125,15 +120,11 @@ describe('platform_browser/popup_redirect', () => {
125120
);
126121
});
127122

128-
it('throws an error if authDomain is unspecified', async () => {
129-
await resolver._initialize(auth);
130-
131-
mockEndpoint(Endpoint.GET_PROJECT_CONFIG, {
132-
authorizedDomains: []
133-
});
123+
it('validates the origin', async () => {
124+
await resolver._initialize(auth);
134125

135-
expect(resolver._openPopup(auth, provider, event)
136-
).to.be.rejectedWith(FirebaseError, 'auth/auth-domain-config-required');
126+
await resolver._openPopup(auth, provider, event);
127+
expect(validateOrigin._validateOrigin).to.have.been.calledWith(auth);
137128
});
138129

139130
it('throws an error if apiKey is unspecified', async () => {

packages-exp/auth-exp/src/platform_browser/strategies/phone.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ describe('platform_browser/strategies/phone', () => {
421421
let idToken: string;
422422

423423
beforeEach(() => {
424-
idToken = makeJWT({exp: '200', iat: '100'})
424+
idToken = makeJWT({exp: '200', iat: '100'});
425425
reloadMock = mockEndpoint(Endpoint.GET_ACCOUNT_INFO, {
426426
users: [{ uid: 'uid' }]
427427
});

0 commit comments

Comments
 (0)