Skip to content

[Auth] Add integration tests for multi-tenancy support #5593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up
  • Loading branch information
sam-gc committed Oct 8, 2021
commit 02f20f484f46fd50e7fae73dd4706a015bc83339
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
import firebase from '@firebase/app-compat';
import { expect, use } from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import { createNewTenant, initializeTestInstance } from '../../helpers/helpers';
import { cleanUpTestInstance } from '../../helpers/helpers';
import { createNewTenant, initializeTestInstance, cleanUpTestInstance } from '../../helpers/helpers';

use(chaiAsPromised);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

import * as fetchImpl from 'node-fetch';
import { API_KEY, getAppConfig, getEmulatorUrl, PROJECT_ID } from './settings';
import { API_KEY, getAppConfig, getEmulatorUrl } from './settings';

export interface VerificationSession {
code: string;
Expand Down Expand Up @@ -79,7 +79,8 @@ export async function createAnonAccount(): Promise<{
}

export async function createNewTenant(): Promise<string> {
const url = `${getEmulatorUrl()}/identitytoolkit.googleapis.com/v2/projects/${PROJECT_ID}/tenants?key=${API_KEY}`;
const projectId = getAppConfig().projectId;
const url = `${getEmulatorUrl()}/identitytoolkit.googleapis.com/v2/projects/${projectId}/tenants?key=${API_KEY}`;
const request = {
name: 'tenant',
allowPasswordSignup: true,
Expand Down
17 changes: 0 additions & 17 deletions packages/auth/test/integration/flows/multi_tenant.local.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,15 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import {
Auth,
createUserWithEmailAndPassword,
FacebookAuthProvider,
getAdditionalUserInfo,
GithubAuthProvider,
GoogleAuthProvider,
linkWithCredential,
OperationType,
ProviderId,
signInAnonymously,
signInWithCredential,
signInWithEmailAndPassword,
signInWithPhoneNumber,
unlink,
updateEmail,
updatePassword,
updateProfile
} from '@firebase/auth';

import { FirebaseError } from '@firebase/util';
import { expect, use } from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import { createNewTenant } from '../../helpers/integration/emulator_rest_helpers';
import {
cleanUpTestInstance,
getTestInstance,
randomEmail
} from '../../helpers/integration/helpers';

use(chaiAsPromised);
Expand Down