Skip to content

Commit 5ba603c

Browse files
committed
test(auth, multi-tenant): add multi-tenant E2E test
this exposed most of the errors fixed in prior commits, and allows you to see that setTenantId is working, but cannot be used against the emulator and we have no valid tenant id in our test project so it is unknown if this is truly working
1 parent 4f6d426 commit 5ba603c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

packages/auth/e2e/auth.e2e.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,4 +1071,25 @@ describe('auth()', function () {
10711071
}
10721072
});
10731073
});
1074+
1075+
describe('setTenantId()', function () {
1076+
it('should return null if tenantId unset', function () {
1077+
should.not.exist(firebase.auth().tenantId);
1078+
});
1079+
1080+
// multi-tenant is not supported by the firebase auth emulator, and requires a valid multi-tenant tenantid
1081+
// After setting this, next user creation will result in internal error on emulator, or auth/invalid-tenant-id live
1082+
// it('should return tenantId correctly after setting', async function () {
1083+
// await firebase.auth().setTenantId('testTenantId');
1084+
// firebase.auth().tenantId.should.equal('testTenantId');
1085+
// });
1086+
// it('user should have tenant after setting tenantId', async function () {
1087+
// await firebase.auth().setTenantId('userTestTenantId');
1088+
// firebase.auth().tenantId.should.equal('userTestTenantId');
1089+
// const random = Utils.randString(12, '#a');
1090+
// const email = `${random}@${random}.com`;
1091+
// const userCredential = await firebase.auth().createUserWithEmailAndPassword(email, random);
1092+
// userCredential.user.tenantId.should.equal('userTestTenantId');
1093+
// });
1094+
});
10741095
});

0 commit comments

Comments
 (0)