fix bad domain event test

This commit is contained in:
sbriat 2023-10-19 14:24:59 +02:00
parent 2c33876d7b
commit e02119e4ee
1 changed files with 2 additions and 6 deletions

View File

@ -1,7 +1,7 @@
import { Test, TestingModule } from '@nestjs/testing';
import { USER_MESSAGE_PUBLISHER } from '@modules/user/user.di-tokens';
import { UserCreatedDomainEvent } from '@modules/user/core/domain/events/user-created.domain-event';
import { PublishMessageWhenUserIsDeletedDomainEventHandler } from '@modules/user/core/application/event-handlers/publish-message-when-user-is-deleted.domain-event-handler';
import { UserDeletedDomainEvent } from '@modules/user/core/domain/events/user-deleted.domain-event';
const mockMessagePublisher = {
publish: jest.fn().mockImplementation(),
@ -29,13 +29,9 @@ describe('Publish message when user is deleted domain event handler', () => {
it('should publish a message', () => {
jest.spyOn(mockMessagePublisher, 'publish');
const userDeletedDomainEvent: UserCreatedDomainEvent = {
const userDeletedDomainEvent: UserDeletedDomainEvent = {
id: 'some-domain-event-id',
aggregateId: 'some-aggregate-id',
firstName: 'John',
lastName: 'Doe',
email: 'john.doe@email.com',
phone: '+33611223344',
metadata: {
timestamp: new Date('2023-06-28T05:00:00Z').getTime(),
correlationId: 'some-correlation-id',