Chatwoot/app/javascript/shared/helpers/specs/CustomErrors.spec.js

14 lines
390 B
JavaScript
Raw Permalink Normal View History

const { DuplicateContactException } = require('../CustomErrors');
describe('DuplicateContactException', () => {
it('returns correct exception', () => {
const exception = new DuplicateContactException({
attributes: ['email'],
});
expect(exception.message).toEqual('DUPLICATE_CONTACT');
expect(exception.data).toEqual({
attributes: ['email'],
});
});
});