From 0343557e18eb4693ce6bdd0054e4a69c43d7f582 Mon Sep 17 00:00:00 2001 From: sbriat Date: Tue, 17 Oct 2023 16:22:47 +0200 Subject: [PATCH] fix tests --- .../tests/unit/authentication.mapper.spec.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/authentication/tests/unit/authentication.mapper.spec.ts b/src/modules/authentication/tests/unit/authentication.mapper.spec.ts index 02046c8..ce78ecc 100644 --- a/src/modules/authentication/tests/unit/authentication.mapper.spec.ts +++ b/src/modules/authentication/tests/unit/authentication.mapper.spec.ts @@ -4,6 +4,7 @@ import { Type } from '@modules/authentication/core/domain/username.types'; import { AuthenticationReadModel, AuthenticationWriteModel, + UsernameModel, } from '@modules/authentication/infrastructure/authentication.repository'; import { AuthenticationResponseDto } from '@modules/authentication/interface/dtos/authentication.response.dto'; import { Test } from '@nestjs/testing'; @@ -63,8 +64,12 @@ describe('Authentication Mapper', () => { it('should map domain entity to persistence data', async () => { const mapped: AuthenticationWriteModel = authenticationMapper.toPersistence(authenticationEntity); - expect(mapped.usernames.create[0].username).toBe('john.doe@email.com'); - expect(mapped.usernames.create[1].username).toBe('+33611223344'); + expect( + (mapped.usernames as { create: UsernameModel[] }).create[0].username, + ).toBe('john.doe@email.com'); + expect( + (mapped.usernames as { create: UsernameModel[] }).create[1].username, + ).toBe('+33611223344'); }); it('should map persisted data to domain entity', async () => {