Skip to content

Commit c528b06

Browse files
committed
Formatting
1 parent 4732a65 commit c528b06

File tree

1 file changed

+57
-10
lines changed

1 file changed

+57
-10
lines changed

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

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
import {expect, use} from 'chai';
1+
/**
2+
* @license
3+
* Copyright 2020 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import { expect, use } from 'chai';
219
import * as sinonChai from 'sinon-chai';
320
import * as sinon from 'sinon';
421
import * as exp from '@firebase/auth-exp/internal';
@@ -25,8 +42,12 @@ describe('popup_redirect/CompatPopupRedirectResolver', () => {
2542
});
2643

2744
context('initialization and resolver selection', () => {
28-
const browserResolver = exp._getInstance<exp.PopupRedirectResolverInternal>(exp.browserPopupRedirectResolver);
29-
const cordovaResolver = exp._getInstance<exp.PopupRedirectResolverInternal>(exp.cordovaPopupRedirectResolver);
45+
const browserResolver = exp._getInstance<exp.PopupRedirectResolverInternal>(
46+
exp.browserPopupRedirectResolver
47+
);
48+
const cordovaResolver = exp._getInstance<exp.PopupRedirectResolverInternal>(
49+
exp.cordovaPopupRedirectResolver
50+
);
3051

3152
beforeEach(() => {
3253
sinon.stub(browserResolver, '_initialize');
@@ -54,29 +75,55 @@ describe('popup_redirect/CompatPopupRedirectResolver', () => {
5475

5576
beforeEach(() => {
5677
underlyingResolver = sinon.createStubInstance(FakeResolver);
57-
(compatResolver as unknown as {underlyingResolver: exp.PopupRedirectResolverInternal}).underlyingResolver = underlyingResolver;
78+
((compatResolver as unknown) as {
79+
underlyingResolver: exp.PopupRedirectResolverInternal;
80+
}).underlyingResolver = underlyingResolver;
5881
provider = new exp.GoogleAuthProvider();
5982
});
6083

6184
it('_openPopup', async () => {
62-
await compatResolver._openPopup(auth, provider, exp.AuthEventType.LINK_VIA_POPUP, 'eventId');
63-
expect(underlyingResolver._openPopup).to.have.been.calledWith(auth, provider, exp.AuthEventType.LINK_VIA_POPUP, 'eventId');
85+
await compatResolver._openPopup(
86+
auth,
87+
provider,
88+
exp.AuthEventType.LINK_VIA_POPUP,
89+
'eventId'
90+
);
91+
expect(underlyingResolver._openPopup).to.have.been.calledWith(
92+
auth,
93+
provider,
94+
exp.AuthEventType.LINK_VIA_POPUP,
95+
'eventId'
96+
);
6497
});
6598

6699
it('_openRedirect', async () => {
67-
await compatResolver._openRedirect(auth, provider, exp.AuthEventType.LINK_VIA_REDIRECT, 'eventId');
68-
expect(underlyingResolver._openRedirect).to.have.been.calledWith(auth, provider, exp.AuthEventType.LINK_VIA_REDIRECT, 'eventId');
100+
await compatResolver._openRedirect(
101+
auth,
102+
provider,
103+
exp.AuthEventType.LINK_VIA_REDIRECT,
104+
'eventId'
105+
);
106+
expect(underlyingResolver._openRedirect).to.have.been.calledWith(
107+
auth,
108+
provider,
109+
exp.AuthEventType.LINK_VIA_REDIRECT,
110+
'eventId'
111+
);
69112
});
70113

71114
it('_isIframeWebStorageSupported', () => {
72115
const cb = (): void => {};
73116
compatResolver._isIframeWebStorageSupported(auth, cb);
74-
expect(underlyingResolver._isIframeWebStorageSupported).to.have.been.calledWith(auth, cb);
117+
expect(
118+
underlyingResolver._isIframeWebStorageSupported
119+
).to.have.been.calledWith(auth, cb);
75120
});
76121

77122
it('_originValidation', async () => {
78123
await compatResolver._originValidation(auth);
79-
expect(underlyingResolver._originValidation).to.have.been.calledWith(auth);
124+
expect(underlyingResolver._originValidation).to.have.been.calledWith(
125+
auth
126+
);
80127
});
81128
});
82129
});

0 commit comments

Comments
 (0)