Skip to content

Commit

Permalink
refactor test
Browse files Browse the repository at this point in the history
  • Loading branch information
clauyan committed Sep 9, 2024
1 parent 748e242 commit 1df6ffa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/modules/authentication/api/userinfo.response.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import { DBiamPersonenkontextRepo } from '../../personenkontext/persistence/dbia
import { OrganisationRepository } from '../../organisation/persistence/organisation.repository.js';
import { RolleRepo } from '../../rolle/repo/rolle.repo.js';
import { PersonenkontextRolleFieldsResponse } from './personen-kontext-rolle-fields.response.js';
import { createMock } from '@golevelup/ts-jest';

describe('UserinfoResponse', () => {
const permissions: PersonPermissions = new PersonPermissions(
jest.fn() as unknown as DBiamPersonenkontextRepo,
jest.fn() as unknown as OrganisationRepository,
jest.fn() as unknown as RolleRepo,
createMock<DBiamPersonenkontextRepo>(),
createMock<OrganisationRepository>(),
createMock<RolleRepo>(),
DoFactory.createPerson(true),
);
const pk: PersonenkontextRolleFieldsResponse = {
Expand All @@ -26,7 +27,7 @@ describe('UserinfoResponse', () => {
expect(userinfoResponse.password_updated_at).toBeUndefined();
});

it('constructs the object without optional extension', () => {
it('constructs the object with optional extension', () => {
const extension: UserinfoExtension = { password_updated_at: faker.date.past().valueOf() };
const userinfoResponse: UserinfoResponse = new UserinfoResponse(permissions, [pk], extension);
expect(userinfoResponse).toBeDefined();
Expand Down

0 comments on commit 1df6ffa

Please sign in to comment.