Skip to content

Commit 577813d

Browse files
committed
Adding integration tests
1 parent 0b89b63 commit 577813d

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

test/integration/auth.spec.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ describe('admin.auth', () => {
12221222
minLength: 6,
12231223
}
12241224
}
1225-
})
1225+
})
12261226
});
12271227

12281228
const mfaSmsEnabledTotpEnabledConfig: MultiFactorConfig = {
@@ -1283,13 +1283,19 @@ describe('admin.auth', () => {
12831283
],
12841284
useAccountDefender: true,
12851285
},
1286+
emailPrivacyConfig: {
1287+
enableImprovedEmailPrivacy: true,
1288+
}
12861289
};
12871290
const projectConfigOption2: UpdateProjectConfigRequest = {
12881291
smsRegionConfig: smsRegionAllowlistOnlyConfig,
12891292
recaptchaConfig: {
12901293
emailPasswordEnforcementState: 'OFF',
12911294
useAccountDefender: false,
12921295
},
1296+
emailPrivacyConfig: {
1297+
enableImprovedEmailPrivacy: false,
1298+
}
12931299
};
12941300
const projectConfigOptionSmsEnabledTotpDisabled: UpdateProjectConfigRequest = {
12951301
smsRegionConfig: smsRegionAllowlistOnlyConfig,
@@ -1309,6 +1315,9 @@ describe('admin.auth', () => {
13091315
],
13101316
useAccountDefender: true,
13111317
},
1318+
emailPrivacyConfig: {
1319+
enableImprovedEmailPrivacy: true,
1320+
},
13121321
};
13131322
const expectedProjectConfig2: any = {
13141323
smsRegionConfig: smsRegionAllowlistOnlyConfig,
@@ -1323,6 +1332,7 @@ describe('admin.auth', () => {
13231332
},
13241333
],
13251334
},
1335+
emailPrivacyConfig: {},
13261336
};
13271337
const expectedProjectConfigSmsEnabledTotpDisabled: any = {
13281338
smsRegionConfig: smsRegionAllowlistOnlyConfig,
@@ -1337,6 +1347,7 @@ describe('admin.auth', () => {
13371347
},
13381348
],
13391349
},
1350+
emailPrivacyConfig: {},
13401351
};
13411352

13421353
it('updateProjectConfig() should resolve with the updated project config', () => {
@@ -1417,6 +1428,9 @@ describe('admin.auth', () => {
14171428
'+16505551234': '019287',
14181429
'+16505550676': '985235',
14191430
},
1431+
emailPrivacyConfig: {
1432+
enableImprovedEmailPrivacy: true,
1433+
},
14201434
};
14211435
const expectedCreatedTenant: any = {
14221436
displayName: 'testTenant1',
@@ -1434,6 +1448,9 @@ describe('admin.auth', () => {
14341448
'+16505551234': '019287',
14351449
'+16505550676': '985235',
14361450
},
1451+
emailPrivacyConfig: {
1452+
enableImprovedEmailPrivacy: true,
1453+
},
14371454
};
14381455
const expectedUpdatedTenant: any = {
14391456
displayName: 'testTenantUpdated',
@@ -1459,6 +1476,7 @@ describe('admin.auth', () => {
14591476
],
14601477
useAccountDefender: true,
14611478
},
1479+
emailPrivacyConfig: {},
14621480
};
14631481
const expectedUpdatedTenant2: any = {
14641482
displayName: 'testTenantUpdated',
@@ -1479,6 +1497,7 @@ describe('admin.auth', () => {
14791497
],
14801498
useAccountDefender: false,
14811499
},
1500+
emailPrivacyConfig: {},
14821501
};
14831502
const expectedUpdatedTenantSmsEnabledTotpDisabled: any = {
14841503
displayName: 'testTenantUpdated',
@@ -1499,6 +1518,7 @@ describe('admin.auth', () => {
14991518
],
15001519
useAccountDefender: false,
15011520
},
1521+
emailPrivacyConfig: {},
15021522
};
15031523

15041524
// https://mochajs.org/
@@ -1912,6 +1932,7 @@ describe('admin.auth', () => {
19121932
multiFactorConfig: deepCopy(expectedUpdatedTenant.multiFactorConfig),
19131933
testPhoneNumbers: deepCopy(expectedUpdatedTenant.testPhoneNumbers),
19141934
recaptchaConfig: deepCopy(expectedUpdatedTenant.recaptchaConfig),
1935+
emailPrivacyConfig: { enableImprovedEmailPrivacy: false },
19151936
};
19161937
const updatedOptions2: UpdateTenantRequest = {
19171938
emailSignInConfig: {
@@ -1923,6 +1944,9 @@ describe('admin.auth', () => {
19231944
testPhoneNumbers: null,
19241945
smsRegionConfig: deepCopy(expectedUpdatedTenant2.smsRegionConfig),
19251946
recaptchaConfig: deepCopy(expectedUpdatedTenant2.recaptchaConfig),
1947+
emailPrivacyConfig: {
1948+
enableImprovedEmailPrivacy: false,
1949+
},
19261950
};
19271951
if (authEmulatorHost) {
19281952
return getAuth().tenantManager().updateTenant(createdTenantId, updatedOptions)
@@ -1998,7 +2022,7 @@ describe('admin.auth', () => {
19982022
}
19992023
return getAuth().tenantManager().updateTenant(createdTenantId, updateRequestNoMfaConfig)
20002024
});
2001-
2025+
20022026
it('updateTenant() should not update tenant reCAPTCHA config is undefined', () => {
20032027
expectedUpdatedTenant.tenantId = createdTenantId;
20042028
const updatedOptions2: UpdateTenantRequest = {

0 commit comments

Comments
 (0)