Skip to content

Commit e228278

Browse files
committed
Formatting
1 parent fa9f8e0 commit e228278

File tree

2 files changed

+55
-21
lines changed

2 files changed

+55
-21
lines changed

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

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ describe('platform_cordova/popup_redirect', () => {
5858
new GoogleAuthProvider(),
5959
AuthEventType.SIGN_IN_VIA_REDIRECT
6060
)
61-
).to.throw(FirebaseError, 'auth/invalid-cordova-configuration')
62-
.that.has.deep.property('customData', {appName: 'test-app', missingPlugin: 'cordova-universal-links-plugin-fix'});
61+
)
62+
.to.throw(FirebaseError, 'auth/invalid-cordova-configuration')
63+
.that.has.deep.property('customData', {
64+
appName: 'test-app',
65+
missingPlugin: 'cordova-universal-links-plugin-fix'
66+
});
6367
});
6468

6569
it('rejects if build info is missing', () => {
@@ -70,8 +74,12 @@ describe('platform_cordova/popup_redirect', () => {
7074
new GoogleAuthProvider(),
7175
AuthEventType.SIGN_IN_VIA_REDIRECT
7276
)
73-
).to.throw(FirebaseError, 'auth/invalid-cordova-configuration')
74-
.that.has.deep.property('customData', {appName: 'test-app', missingPlugin: 'cordova-plugin-buildInfo'});
77+
)
78+
.to.throw(FirebaseError, 'auth/invalid-cordova-configuration')
79+
.that.has.deep.property('customData', {
80+
appName: 'test-app',
81+
missingPlugin: 'cordova-plugin-buildInfo'
82+
});
7583
});
7684

7785
it('rejects if browsertab openUrl is missing', () => {
@@ -82,8 +90,12 @@ describe('platform_cordova/popup_redirect', () => {
8290
new GoogleAuthProvider(),
8391
AuthEventType.SIGN_IN_VIA_REDIRECT
8492
)
85-
).to.throw(FirebaseError, 'auth/invalid-cordova-configuration')
86-
.that.has.deep.property('customData', {appName: 'test-app', missingPlugin: 'cordova-plugin-browsertab'});
93+
)
94+
.to.throw(FirebaseError, 'auth/invalid-cordova-configuration')
95+
.that.has.deep.property('customData', {
96+
appName: 'test-app',
97+
missingPlugin: 'cordova-plugin-browsertab'
98+
});
8799
});
88100

89101
it('rejects if InAppBrowser is missing', () => {
@@ -94,15 +106,19 @@ describe('platform_cordova/popup_redirect', () => {
94106
new GoogleAuthProvider(),
95107
AuthEventType.SIGN_IN_VIA_REDIRECT
96108
)
97-
).to.throw(FirebaseError, 'auth/invalid-cordova-configuration')
98-
.that.has.deep.property('customData', {appName: 'test-app', missingPlugin: 'cordova-plugin-inappbrowser'});
109+
)
110+
.to.throw(FirebaseError, 'auth/invalid-cordova-configuration')
111+
.that.has.deep.property('customData', {
112+
appName: 'test-app',
113+
missingPlugin: 'cordova-plugin-inappbrowser'
114+
});
99115
});
100116
});
101117
});
102118

103119
function attachExpectedPlugins(): void {
104120
// Eventually these will be replaced with full mocks
105-
const win = window as unknown as Record<string, unknown>;
121+
const win = (window as unknown) as Record<string, unknown>;
106122
win.cordova = {
107123
plugins: {
108124
browsertab: {
@@ -122,6 +138,6 @@ function attachExpectedPlugins(): void {
122138
};
123139
}
124140

125-
function removeProp(obj: unknown, prop: string):void {
141+
function removeProp(obj: unknown, prop: string): void {
126142
delete (obj as Record<string, unknown>)[prop];
127-
}
143+
}

packages-exp/auth-exp/src/platform_cordova/popup_redirect.ts

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,26 +61,44 @@ function checkCordovaConfiguration(auth: Auth): void {
6161
// Note that cordova-universal-links-plugin has been abandoned.
6262
// A fork with latest fixes is available at:
6363
// https://www.npmjs.com/package/cordova-universal-links-plugin-fix
64-
_assert(typeof window?.universalLinks?.subscribe === 'function', auth, AuthErrorCode.INVALID_CORDOVA_CONFIGURATION, {
64+
_assert(
65+
typeof window?.universalLinks?.subscribe === 'function',
66+
auth,
67+
AuthErrorCode.INVALID_CORDOVA_CONFIGURATION,
68+
{
6569
missingPlugin: 'cordova-universal-links-plugin-fix'
66-
});
70+
}
71+
);
6772

6873
// https://www.npmjs.com/package/cordova-plugin-buildinfo
69-
_assert (typeof window?.BuildInfo?.packageName !== 'undefined', auth, AuthErrorCode.INVALID_CORDOVA_CONFIGURATION, {
74+
_assert(
75+
typeof window?.BuildInfo?.packageName !== 'undefined',
76+
auth,
77+
AuthErrorCode.INVALID_CORDOVA_CONFIGURATION,
78+
{
7079
missingPlugin: 'cordova-plugin-buildInfo'
71-
});
80+
}
81+
);
7282

7383
// https://github.com/google/cordova-plugin-browsertab
74-
_assert(typeof window?.cordova?.plugins?.browsertab?.openUrl === 'function',
75-
auth, AuthErrorCode.INVALID_CORDOVA_CONFIGURATION, {
84+
_assert(
85+
typeof window?.cordova?.plugins?.browsertab?.openUrl === 'function',
86+
auth,
87+
AuthErrorCode.INVALID_CORDOVA_CONFIGURATION,
88+
{
7689
missingPlugin: 'cordova-plugin-browsertab'
77-
});
90+
}
91+
);
7892

7993
// https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/
80-
_assert(typeof window?.cordova?.InAppBrowser?.open === 'function',
81-
auth, AuthErrorCode.INVALID_CORDOVA_CONFIGURATION, {
94+
_assert(
95+
typeof window?.cordova?.InAppBrowser?.open === 'function',
96+
auth,
97+
AuthErrorCode.INVALID_CORDOVA_CONFIGURATION,
98+
{
8299
missingPlugin: 'cordova-plugin-inappbrowser'
83-
});
100+
}
101+
);
84102
}
85103

86104
/**

0 commit comments

Comments
 (0)