Skip to content

Commit 02c1f12

Browse files
committed
Formatting
1 parent 3eea66b commit 02c1f12

File tree

5 files changed

+85
-38
lines changed

5 files changed

+85
-38
lines changed

packages-exp/auth-exp/test/integration/flows/phone.test.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -140,31 +140,31 @@ describe('Integration test: phone auth', () => {
140140
const { uid: anonId } = user;
141141

142142
const provider = new PhoneAuthProvider(auth);
143-
const verificationId = await provider.verifyPhoneNumber(
144-
PHONE_B.phoneNumber,
145-
verifier
146-
);
143+
const verificationId = await provider.verifyPhoneNumber(
144+
PHONE_B.phoneNumber,
145+
verifier
146+
);
147147

148-
await updatePhoneNumber(
149-
user,
150-
PhoneAuthProvider.credential(
151-
verificationId,
152-
await code(verificationId, PHONE_B.code)
153-
)
154-
);
155-
expect(user.phoneNumber).to.eq(PHONE_B.phoneNumber);
148+
await updatePhoneNumber(
149+
user,
150+
PhoneAuthProvider.credential(
151+
verificationId,
152+
await code(verificationId, PHONE_B.code)
153+
)
154+
);
155+
expect(user.phoneNumber).to.eq(PHONE_B.phoneNumber);
156156

157-
await auth.signOut();
158-
resetVerifier();
157+
await auth.signOut();
158+
resetVerifier();
159159

160-
const cr = await signInWithPhoneNumber(auth, PHONE_B.phoneNumber, verifier);
161-
const { user: secondSignIn } = await cr.confirm(
162-
await code(cr, PHONE_B.code)
163-
);
164-
expect(secondSignIn.uid).to.eq(anonId);
165-
expect(secondSignIn.isAnonymous).to.be.false;
166-
expect(secondSignIn.providerData[0].phoneNumber).to.eq(PHONE_B.phoneNumber);
167-
expect(secondSignIn.providerData[0].providerId).to.eq('phone');
160+
const cr = await signInWithPhoneNumber(auth, PHONE_B.phoneNumber, verifier);
161+
const { user: secondSignIn } = await cr.confirm(
162+
await code(cr, PHONE_B.code)
163+
);
164+
expect(secondSignIn.uid).to.eq(anonId);
165+
expect(secondSignIn.isAnonymous).to.be.false;
166+
expect(secondSignIn.providerData[0].phoneNumber).to.eq(PHONE_B.phoneNumber);
167+
expect(secondSignIn.providerData[0].providerId).to.eq('phone');
168168
});
169169

170170
context('with already-created user', () => {

packages-exp/auth-exp/test/integration/webdriver/popup.test.ts

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ import { expect, use } from 'chai';
2626
import { IdPPage } from './util/idp_page';
2727
import * as chaiAsPromised from 'chai-as-promised';
2828
import { browserDescribe } from './util/test_runner';
29-
import { AnonFunction, CoreFunction, EmailFunction, PopupFunction } from './util/functions';
29+
import {
30+
AnonFunction,
31+
CoreFunction,
32+
EmailFunction,
33+
PopupFunction
34+
} from './util/functions';
3035

3136
use(chaiAsPromised);
3237

@@ -147,7 +152,9 @@ browserDescribe('Popup IdP tests', driver => {
147152
});
148153

149154
it('does not auto-upgrade anon accounts', async () => {
150-
const {user: anonUser}: UserCredential = await driver.call(AnonFunction.SIGN_IN_ANONYMOUSLY);
155+
const { user: anonUser }: UserCredential = await driver.call(
156+
AnonFunction.SIGN_IN_ANONYMOUSLY
157+
);
151158
await driver.callNoWait(PopupFunction.IDP_POPUP);
152159
await driver.selectPopupWindow();
153160
const widget = new IdPPage(driver.webDriver);
@@ -163,7 +170,9 @@ browserDescribe('Popup IdP tests', driver => {
163170
});
164171

165172
it('linking with anonymous user upgrades account', async () => {
166-
const {user: anonUser}: UserCredential = await driver.call(AnonFunction.SIGN_IN_ANONYMOUSLY);
173+
const { user: anonUser }: UserCredential = await driver.call(
174+
AnonFunction.SIGN_IN_ANONYMOUSLY
175+
);
167176
await driver.callNoWait(PopupFunction.IDP_LINK_POPUP);
168177
await driver.selectPopupWindow();
169178
const widget = new IdPPage(driver.webDriver);
@@ -180,8 +189,11 @@ browserDescribe('Popup IdP tests', driver => {
180189
});
181190

182191
it('is possible to link with different email', async () => {
183-
const {user: emailUser}: UserCredential = await driver.call(EmailFunction.CREATE_USER, '[email protected]');
184-
192+
const { user: emailUser }: UserCredential = await driver.call(
193+
EmailFunction.CREATE_USER,
194+
195+
);
196+
185197
// Link using pre-poulated user
186198
await driver.callNoWait(PopupFunction.IDP_LINK_POPUP);
187199
await driver.selectPopupWindow();
@@ -200,8 +212,11 @@ browserDescribe('Popup IdP tests', driver => {
200212
});
201213

202214
it('is possible to link with the same email', async () => {
203-
const {user: emailUser}: UserCredential = await driver.call(EmailFunction.CREATE_USER, '[email protected]');
204-
215+
const { user: emailUser }: UserCredential = await driver.call(
216+
EmailFunction.CREATE_USER,
217+
218+
);
219+
205220
// Link using pre-poulated user
206221
await driver.callNoWait(PopupFunction.IDP_LINK_POPUP);
207222
await driver.selectPopupWindow();

packages-exp/auth-exp/test/integration/webdriver/redirect.test.ts

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ import { expect, use } from 'chai';
2626
import { IdPPage } from './util/idp_page';
2727
import * as chaiAsPromised from 'chai-as-promised';
2828
import { browserDescribe } from './util/test_runner';
29-
import { AnonFunction, CoreFunction, EmailFunction, RedirectFunction } from './util/functions';
29+
import {
30+
AnonFunction,
31+
CoreFunction,
32+
EmailFunction,
33+
RedirectFunction
34+
} from './util/functions';
3035

3136
use(chaiAsPromised);
3237

@@ -147,7 +152,9 @@ browserDescribe('WebDriver redirect IdP test', driver => {
147152
});
148153

149154
it('does not auto-upgrade anon accounts', async () => {
150-
const {user: anonUser}: UserCredential = await driver.call(AnonFunction.SIGN_IN_ANONYMOUSLY);
155+
const { user: anonUser }: UserCredential = await driver.call(
156+
AnonFunction.SIGN_IN_ANONYMOUSLY
157+
);
151158
await driver.callNoWait(RedirectFunction.IDP_REDIRECT);
152159
const widget = new IdPPage(driver.webDriver);
153160
await widget.pageLoad();
@@ -162,7 +169,9 @@ browserDescribe('WebDriver redirect IdP test', driver => {
162169
});
163170

164171
it('linking with anonymous user upgrades account', async () => {
165-
const {user: anonUser}: UserCredential = await driver.call(AnonFunction.SIGN_IN_ANONYMOUSLY);
172+
const { user: anonUser }: UserCredential = await driver.call(
173+
AnonFunction.SIGN_IN_ANONYMOUSLY
174+
);
166175
await driver.callNoWait(RedirectFunction.IDP_LINK_REDIRECT);
167176
const widget = new IdPPage(driver.webDriver);
168177
await widget.pageLoad();
@@ -178,8 +187,11 @@ browserDescribe('WebDriver redirect IdP test', driver => {
178187
});
179188

180189
it('is possible to link with different email', async () => {
181-
const {user: emailUser}: UserCredential = await driver.call(EmailFunction.CREATE_USER, '[email protected]');
182-
190+
const { user: emailUser }: UserCredential = await driver.call(
191+
EmailFunction.CREATE_USER,
192+
193+
);
194+
183195
// Link using pre-poulated user
184196
await driver.callNoWait(RedirectFunction.IDP_LINK_REDIRECT);
185197

@@ -198,8 +210,11 @@ browserDescribe('WebDriver redirect IdP test', driver => {
198210
});
199211

200212
it('is possible to link with the same email', async () => {
201-
const {user: emailUser}: UserCredential = await driver.call(EmailFunction.CREATE_USER, '[email protected]');
202-
213+
const { user: emailUser }: UserCredential = await driver.call(
214+
EmailFunction.CREATE_USER,
215+
216+
);
217+
203218
// Link using pre-poulated user
204219
await driver.callNoWait(RedirectFunction.IDP_LINK_REDIRECT);
205220

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
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+
118
import { createUserWithEmailAndPassword } from '@firebase/auth-exp';
219

320
const TEST_PASSWORD = 'password';
421

522
export function createUser(email) {
623
return createUserWithEmailAndPassword(auth, email, TEST_PASSWORD);
7-
}
24+
}

packages-exp/auth-exp/test/integration/webdriver/util/functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export enum PopupFunction {
4848

4949
/** Available email functions. See static/email.js */
5050
export enum EmailFunction {
51-
CREATE_USER = 'email.createUser',
51+
CREATE_USER = 'email.createUser'
5252
}
5353

5454
/** Available core functions within the browser. See static/core.js */

0 commit comments

Comments
 (0)