mirror of
https://gitlab.com/mobicoop/v3/service/auth.git
synced 2026-01-30 15:30:45 +00:00
fix tests
This commit is contained in:
@@ -4,6 +4,7 @@ import { Type } from '@modules/authentication/core/domain/username.types';
|
|||||||
import {
|
import {
|
||||||
AuthenticationReadModel,
|
AuthenticationReadModel,
|
||||||
AuthenticationWriteModel,
|
AuthenticationWriteModel,
|
||||||
|
UsernameModel,
|
||||||
} from '@modules/authentication/infrastructure/authentication.repository';
|
} from '@modules/authentication/infrastructure/authentication.repository';
|
||||||
import { AuthenticationResponseDto } from '@modules/authentication/interface/dtos/authentication.response.dto';
|
import { AuthenticationResponseDto } from '@modules/authentication/interface/dtos/authentication.response.dto';
|
||||||
import { Test } from '@nestjs/testing';
|
import { Test } from '@nestjs/testing';
|
||||||
@@ -63,8 +64,12 @@ describe('Authentication Mapper', () => {
|
|||||||
it('should map domain entity to persistence data', async () => {
|
it('should map domain entity to persistence data', async () => {
|
||||||
const mapped: AuthenticationWriteModel =
|
const mapped: AuthenticationWriteModel =
|
||||||
authenticationMapper.toPersistence(authenticationEntity);
|
authenticationMapper.toPersistence(authenticationEntity);
|
||||||
expect(mapped.usernames.create[0].username).toBe('john.doe@email.com');
|
expect(
|
||||||
expect(mapped.usernames.create[1].username).toBe('+33611223344');
|
(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 () => {
|
it('should map persisted data to domain entity', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user