fallbackEmail is now independent from email
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user