2020-08-22 18:35:07 +00:00
|
|
|
const { DuplicateContactException } = require('../CustomErrors');
|
|
|
|
|
|
|
|
describe('DuplicateContactException', () => {
|
|
|
|
it('returns correct exception', () => {
|
|
|
|
const exception = new DuplicateContactException({
|
2021-12-03 07:49:11 +00:00
|
|
|
attributes: ['email'],
|
2020-08-22 18:35:07 +00:00
|
|
|
});
|
|
|
|
expect(exception.message).toEqual('DUPLICATE_CONTACT');
|
|
|
|
expect(exception.data).toEqual({
|
2021-12-03 07:49:11 +00:00
|
|
|
attributes: ['email'],
|
2020-08-22 18:35:07 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|