Move MailError to BoxError

This commit is contained in:
Girish Ramakrishnan
2019-10-24 13:34:14 -07:00
parent a017af41c5
commit 1a8496d61e
8 changed files with 156 additions and 223 deletions

View File

@@ -2006,7 +2006,7 @@ describe('database', function () {
it('cannot add dup entry', function (done) {
mailboxdb.addMailbox('girish', DOMAIN_0.domain, 'uid-1', function (error) {
expect(error.reason).to.be(DatabaseError.ALREADY_EXISTS);
expect(error.reason).to.be(BoxError.ALREADY_EXISTS);
done();
});
});
@@ -2091,7 +2091,7 @@ describe('database', function () {
it('cannot get non-existing group', function (done) {
mailboxdb.getList('random', DOMAIN_0.domain, function (error) {
expect(error.reason).to.be(DatabaseError.NOT_FOUND);
expect(error.reason).to.be(BoxError.NOT_FOUND);
done();
});
});
@@ -2107,7 +2107,7 @@ describe('database', function () {
it('cannot change name to existing one', function (done) {
mailboxdb.updateName('support', DOMAIN_0.domain, 'support2', DOMAIN_0.domain, function (error) {
expect(error).to.be.ok();
expect(error.reason).to.eql(DatabaseError.ALREADY_EXISTS);
expect(error.reason).to.eql(BoxError.ALREADY_EXISTS);
done();
});
@@ -2138,7 +2138,7 @@ describe('database', function () {
mailboxdb.getByOwnerId('osticket', function (error) {
expect(error).to.be.ok();
expect(error.reason).to.be(DatabaseError.NOT_FOUND);
expect(error.reason).to.be(BoxError.NOT_FOUND);
done();
});
});
@@ -2166,7 +2166,7 @@ describe('database', function () {
it('cannot add non-existing domain', function (done) {
maildb.add(MAIL_DOMAIN_0.domain + 'nope', {}, function (error) {
expect(error).to.be.ok();
expect(error.reason).to.be(DatabaseError.NOT_FOUND);
expect(error.reason).to.be(BoxError.NOT_FOUND);
done();
});