Merge branch 'fixTests' into 'main'

Fix tests

See merge request v3/service/user!47
This commit is contained in:
Sylvain Briat 2023-10-19 12:28:18 +00:00
commit 4a8460318e
3 changed files with 5 additions and 9 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@mobicoop/user", "name": "@mobicoop/user",
"version": "1.3.0", "version": "1.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@mobicoop/user", "name": "@mobicoop/user",
"version": "1.3.0", "version": "1.3.1",
"license": "AGPL", "license": "AGPL",
"dependencies": { "dependencies": {
"@grpc/grpc-js": "^1.9.6", "@grpc/grpc-js": "^1.9.6",

View File

@ -1,6 +1,6 @@
{ {
"name": "@mobicoop/user", "name": "@mobicoop/user",
"version": "1.3.0", "version": "1.3.1",
"description": "Mobicoop V3 User Service", "description": "Mobicoop V3 User Service",
"author": "sbriat", "author": "sbriat",
"private": true, "private": true,

View File

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