Skip to content

Commit 00face3

Browse files
committed
Formatting
1 parent a76cde3 commit 00face3

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
@@ -148,18 +148,26 @@ export class AuthDriver {
148148

149149
async selectPopupWindow(): Promise<void> {
150150
const currentWindowHandle = await this.webDriver.getWindowHandle();
151-
const condition = new Condition('Waiting for popup to open', async driver => {
152-
return (await driver.getAllWindowHandles()).length > 1;
153-
});
151+
const condition = new Condition(
152+
'Waiting for popup to open',
153+
async driver => {
154+
return (await driver.getAllWindowHandles()).length > 1;
155+
}
156+
);
154157
await this.webDriver.wait(condition);
155158
const handles = await this.webDriver.getAllWindowHandles();
156-
return this.webDriver.switchTo().window(handles.find(h => h !== currentWindowHandle)!);
159+
return this.webDriver
160+
.switchTo()
161+
.window(handles.find(h => h !== currentWindowHandle)!);
157162
}
158163

159164
async selectMainWindow(): Promise<void> {
160-
const condition = new Condition('Waiting for popup to close', async driver => {
161-
return (await driver.getAllWindowHandles()).length === 1;
162-
});
165+
const condition = new Condition(
166+
'Waiting for popup to close',
167+
async driver => {
168+
return (await driver.getAllWindowHandles()).length === 1;
169+
}
170+
);
163171
await this.webDriver.wait(condition);
164172
const handles = await this.webDriver.getAllWindowHandles();
165173
return this.webDriver.switchTo().window(handles[0]);

0 commit comments

Comments
 (0)