Skip to content

Commit

Permalink
EW-561 fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
psachmann committed Oct 18, 2023
1 parent 9e0e08f commit e5c2e7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/modules/person/api/person.uc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ describe('PersonUc', () => {
const result: Paged<PersonendatensatzResponse> = await personUc.findAll(personDTO);

expect(personenkontextServiceMock.findAllPersonenkontexte).toHaveBeenCalledTimes(2);
expect(result).toHaveLength(2);
expect(result.items).toHaveLength(2);
expect(result.items.at(0)?.person.name.vorname).toEqual(firstPerson.firstName);
expect(result.items.at(0)?.person.name.familienname).toEqual(firstPerson.lastName);
expect(result.items.at(1)?.person.name.vorname).toEqual(secondPerson.firstName);
Expand Down
9 changes: 5 additions & 4 deletions src/modules/person/api/personen-query.param.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { plainToInstance } from 'class-transformer';
import 'reflect-metadata';
import { PersonenQueryParam, SichtfreigabeType } from './personen-query.param.js';
import { PersonenQueryParams, SichtfreigabeType } from './personen-query.param.js';
import { faker } from '@faker-js/faker';

describe('PersonenQueryParam', () => {
const referenceParams: PersonenQueryParam = {
const referenceParams: PersonenQueryParams = {
sichtfreigabe: SichtfreigabeType.JA,
familienname: faker.person.lastName(),
referrer: 'referrer',
Expand All @@ -18,8 +18,9 @@ describe('PersonenQueryParam', () => {
referrer: referenceParams.referrer,
vorname: referenceParams.vorname,
};
const mappedParams: PersonenQueryParam = plainToInstance(PersonenQueryParam, incomingParams, {});
expect(mappedParams).toBeInstanceOf(PersonenQueryParam);
const mappedParams: PersonenQueryParams = plainToInstance(PersonenQueryParams, incomingParams, {});

expect(mappedParams).toBeInstanceOf(PersonenQueryParams);
expect(mappedParams).toEqual(referenceParams);
});
});

0 comments on commit e5c2e7f

Please sign in to comment.