Skip to content

Commit 63985fa

Browse files
committed
Formatting
1 parent fb0f566 commit 63985fa

File tree

5 files changed

+46
-19
lines changed

5 files changed

+46
-19
lines changed

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ browserDescribe('Popup IdP tests', driver => {
4646
await widget.clickSignIn();
4747

4848
await driver.selectMainWindow();
49-
const result: UserCredential = await driver.call(PopupFunction.POPUP_RESULT);
49+
const result: UserCredential = await driver.call(
50+
PopupFunction.POPUP_RESULT
51+
);
5052
const currentUser = await driver.getUserSnapshot();
5153
expect(currentUser.email).to.eq('[email protected]');
5254
expect(currentUser.displayName).to.eq('Bob Test');
@@ -240,7 +242,12 @@ browserDescribe('Popup IdP tests', driver => {
240242
// Don't actually sign in; go back to the previous page
241243
await widget.pageLoad();
242244
await driver.closePopup();
243-
await expect(driver.call(PopupFunction.POPUP_RESULT)).to.be.rejected.and.eventually.have.property('code', 'auth/popup-closed-by-user');
245+
await expect(
246+
driver.call(PopupFunction.POPUP_RESULT)
247+
).to.be.rejected.and.eventually.have.property(
248+
'code',
249+
'auth/popup-closed-by-user'
250+
);
244251
expect(await driver.getUserSnapshot()).to.be.null;
245252

246253
// Now do sign in
@@ -261,12 +268,17 @@ browserDescribe('Popup IdP tests', driver => {
261268
await driver.selectPopupWindow();
262269
await widget.pageLoad();
263270
await driver.closePopup();
264-
await expect(driver.call(PopupFunction.POPUP_RESULT)).to.be.rejected.and.eventually.have.property('code', 'auth/popup-closed-by-user');
271+
await expect(
272+
driver.call(PopupFunction.POPUP_RESULT)
273+
).to.be.rejected.and.eventually.have.property(
274+
'code',
275+
'auth/popup-closed-by-user'
276+
);
265277

266278
// Make sure state remained
267279
user = await driver.getUserSnapshot();
268280
expect(user.uid).to.eq(user1.uid);
269281
expect(user.email).to.eq(user1.email);
270-
}).timeout(12_000); // Test takes a while due to the closed-by-user errors
282+
}).timeout(12_000); // Test takes a while due to the closed-by-user errors
271283
});
272284
});

packages-exp/auth-exp/test/integration/webdriver/static/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import * as popup from './popup';
2222
import { initializeApp } from '@firebase/app-exp';
2323
import { getAuth, useAuthEmulator } from '@firebase/auth-exp';
2424

25-
window.core = {...core};
26-
window.anonymous = {...anonymous};
27-
window.redirect = {...redirect};
28-
window.popup = {...popup};
25+
window.core = { ...core };
26+
window.anonymous = { ...anonymous };
27+
window.redirect = { ...redirect };
28+
window.popup = { ...popup };
2929

3030
// The config and emulator URL are injected by the test. The test framework
3131
// calls this function after that injection.

packages-exp/auth-exp/test/integration/webdriver/static/popup.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,17 @@ export function idpPopup(optProvider) {
4141
}
4242

4343
export function idpReauthPopup() {
44-
window.popup.popupPromise =
45-
reauthenticateWithPopup(auth.currentUser, new GoogleAuthProvider());
44+
window.popup.popupPromise = reauthenticateWithPopup(
45+
auth.currentUser,
46+
new GoogleAuthProvider()
47+
);
4648
}
4749

4850
export function idpLinkPopup() {
49-
window.popup.popupPromise = linkWithPopup(auth.currentUser, new GoogleAuthProvider());
51+
window.popup.popupPromise = linkWithPopup(
52+
auth.currentUser,
53+
new GoogleAuthProvider()
54+
);
5055
}
5156

5257
export function popupResult() {

packages-exp/auth-exp/test/integration/webdriver/static/redirect.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ export function redirectResult() {
4848

4949
export async function generateCredentialFromRedirectResultAndStore() {
5050
const result = await getRedirectResult(auth);
51-
window.redirect.redirectCred = GoogleAuthProvider.credentialFromResult(result);
51+
window.redirect.redirectCred = GoogleAuthProvider.credentialFromResult(
52+
result
53+
);
5254
return window.redirect.redirectCred;
5355
}
5456

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

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,26 @@ export class AuthDriver {
140140

141141
async selectPopupWindow(): Promise<void> {
142142
const currentWindowHandle = await this.webDriver.getWindowHandle();
143-
const condition = new Condition('Waiting for popup to open', async driver => {
144-
return (await driver.getAllWindowHandles()).length > 1;
145-
});
143+
const condition = new Condition(
144+
'Waiting for popup to open',
145+
async driver => {
146+
return (await driver.getAllWindowHandles()).length > 1;
147+
}
148+
);
146149
await this.webDriver.wait(condition);
147150
const handles = await this.webDriver.getAllWindowHandles();
148-
return this.webDriver.switchTo().window(handles.find(h => h !== currentWindowHandle)!);
151+
return this.webDriver
152+
.switchTo()
153+
.window(handles.find(h => h !== currentWindowHandle)!);
149154
}
150155

151156
async selectMainWindow(): Promise<void> {
152-
const condition = new Condition('Waiting for popup to close', async driver => {
153-
return (await driver.getAllWindowHandles()).length === 1;
154-
});
157+
const condition = new Condition(
158+
'Waiting for popup to close',
159+
async driver => {
160+
return (await driver.getAllWindowHandles()).length === 1;
161+
}
162+
);
155163
await this.webDriver.wait(condition);
156164
const handles = await this.webDriver.getAllWindowHandles();
157165
return this.webDriver.switchTo().window(handles[0]);

0 commit comments

Comments
 (0)