fallbackEmail is now independent from email

This commit is contained in:
Johannes Zellner
2021-10-26 22:50:02 +02:00
parent 2f510c2625
commit daf212468f
5 changed files with 40 additions and 7 deletions
+7 -1
View File
@@ -83,6 +83,12 @@ describe('User', function () {
expect(error.reason).to.equal(BoxError.BAD_FIELD);
});
it('fails because fallbackEmail is not an email', async function () {
const user = Object.assign({}, admin, { fallbackEmail: 'notanemail' });
const [error] = await safe(users.add(user.email, user, auditSource));
expect(error.reason).to.equal(BoxError.BAD_FIELD);
});
it('can add user', async function () {
const id = await users.add(admin.email, admin, auditSource);
admin.id = id;
@@ -403,7 +409,7 @@ describe('User', function () {
const result = await users.get(admin.id);
expect(result.id).to.equal(admin.id);
expect(result.email).to.equal(admin.email.toLowerCase());
expect(result.fallbackEmail).to.equal(admin.email.toLowerCase());
expect(result.fallbackEmail).to.equal(admin.fallbackEmail.toLowerCase());
expect(result.username).to.equal(admin.username.toLowerCase());
expect(result.displayName).to.equal(admin.displayName);
});