Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-gc committed Jul 1, 2021
1 parent a37b7fd commit 3f3f1aa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ describe('platform_cordova/popup_redirect/popup_redirect', () => {

beforeEach(async () => {
auth = await testAuth();
resolver = new (cordovaPopupRedirectResolver as SingletonInstantiator<PopupRedirectResolverInternal>)();
resolver =
new (cordovaPopupRedirectResolver as SingletonInstantiator<PopupRedirectResolverInternal>)();
provider = new GoogleAuthProvider();
utilsStubs = sinon.stub(utils);
eventsStubs = {
Expand All @@ -88,7 +89,7 @@ describe('platform_cordova/popup_redirect/popup_redirect', () => {
afterEach(() => {
sinon.restore();
universalLinksCb = null;
const anyWindow = (win as unknown) as Record<string, unknown>;
const anyWindow = win as unknown as Record<string, unknown>;
delete anyWindow.universalLinks;
delete anyWindow.BuildInfo;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ class CordovaPopupRedirectResolver implements PopupRedirectResolverInternal {
*
* @public
*/
export const cordovaPopupRedirectResolver: PopupRedirectResolver = CordovaPopupRedirectResolver;
export const cordovaPopupRedirectResolver: PopupRedirectResolver =
CordovaPopupRedirectResolver;

function generateNoEvent(): AuthEvent {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,22 +190,26 @@ describe('platform_cordova/popup_redirect/utils', () => {
describe('_validateOrigin', () => {
beforeEach(() => {
sinon.stub(win.BuildInfo, 'packageName').value('com.example.myapp');
sinon.stub(projectConfig, '_getProjectConfig').returns(Promise.resolve({/* does not matter here */ authorizedDomains: []}));
sinon
.stub(projectConfig, '_getProjectConfig')
.returns(
Promise.resolve({ /* does not matter here */ authorizedDomains: [] })
);
});

it('sets the correct fields for android', async () => {
setUA(ANDROID_UA);
await _validateOrigin(auth);
expect(projectConfig._getProjectConfig).to.have.been.calledWith(auth, {
androidPackageName: 'com.example.myapp',
androidPackageName: 'com.example.myapp'
});
});

it('sets the correct fields for ios', async () => {
setUA(IOS_UA);
await _validateOrigin(auth);
expect(projectConfig._getProjectConfig).to.have.been.calledWith(auth, {
iosBundleId: 'com.example.myapp',
iosBundleId: 'com.example.myapp'
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ import { _getRedirectUrl } from '../../core/util/handler';
import { AuthInternal } from '../../model/auth';
import { AuthEvent } from '../../model/popup_redirect';
import { InAppBrowserRef, _cordovaWindow } from '../plugins';
import { GetProjectConfigRequest, _getProjectConfig } from '../../api/project_config/get_project_config';
import {
GetProjectConfigRequest,
_getProjectConfig
} from '../../api/project_config/get_project_config';

/**
* How long to wait after the app comes back into focus before concluding that
Expand Down

0 comments on commit 3f3f1aa

Please sign in to comment.