2023-06-21 11:56:59 +03:00
|
|
|
const assert = require('assert/strict');
|
2022-11-24 09:54:20 +03:00
|
|
|
const ObjectID = require('bson-objectid').default;
|
|
|
|
const EmailBouncedEvent = require('../../lib/EmailBouncedEvent');
|
|
|
|
|
|
|
|
describe('EmailBouncedEvent', function () {
|
|
|
|
it('exports a static create method to create instances', function () {
|
|
|
|
const event = EmailBouncedEvent.create({
|
2022-12-01 12:00:53 +03:00
|
|
|
id: 'id',
|
2022-11-24 09:54:20 +03:00
|
|
|
email: 'test@test.test',
|
2022-11-29 13:15:19 +03:00
|
|
|
memberId: new ObjectID().toHexString(),
|
|
|
|
emailId: new ObjectID().toHexString(),
|
|
|
|
emailRecipientId: new ObjectID().toHexString(),
|
2022-12-01 12:00:53 +03:00
|
|
|
timestamp: new Date(),
|
|
|
|
error: {
|
|
|
|
message: 'test',
|
|
|
|
code: 1,
|
|
|
|
enhancedCode: '1.1'
|
|
|
|
}
|
2022-11-24 09:54:20 +03:00
|
|
|
});
|
|
|
|
assert(event instanceof EmailBouncedEvent);
|
|
|
|
});
|
|
|
|
});
|