From 5888500ad47ca7aa61f94c6d04591892e3bfa232 Mon Sep 17 00:00:00 2001 From: Maximilian Kreuzkam Date: Thu, 11 Jan 2024 12:11:07 +0100 Subject: [PATCH] Fix unit tests. --- apps/server/src/modules/account/uc/account.uc.spec.ts | 8 +++++--- .../authentication/strategy/oauth2.strategy.spec.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/server/src/modules/account/uc/account.uc.spec.ts b/apps/server/src/modules/account/uc/account.uc.spec.ts index 6e9b8b628f0..1a4adcca19b 100644 --- a/apps/server/src/modules/account/uc/account.uc.spec.ts +++ b/apps/server/src/modules/account/uc/account.uc.spec.ts @@ -15,7 +15,6 @@ import { AccountService } from '..'; import { AccountByIdBodyParams, AccountByIdParams, - AccountResponse, AccountSearchQueryParams, AccountSearchType, } from '../controller/dto'; @@ -23,7 +22,7 @@ import { Account } from '../domain'; import { AccountEntityToDoMapper } from '../repo/mapper'; import { AccountValidationService } from '../services/account.validation.service'; import { AccountUc } from './account.uc'; -import { ResolvedSearchListAccountDto } from './dto/resolved-account.dto'; +import { ResolvedAccountDto, ResolvedSearchListAccountDto } from './dto/resolved-account.dto'; describe('AccountUc', () => { let module: TestingModule; @@ -1061,12 +1060,15 @@ describe('AccountUc', () => { ); const expected = new ResolvedSearchListAccountDto( [ - new AccountResponse({ + new ResolvedAccountDto({ id: mockStudentAccount.id ?? '', userId: mockStudentAccount.userId?.toString(), activated: mockStudentAccount.activated, username: mockStudentAccount.username, updatedAt: mockStudentAccount.updatedAt, + password: mockStudentAccount.password, + createdAt: mockStudentAccount.createdAt, + systemId: mockStudentAccount.systemId?.toString(), }), ], 1, diff --git a/apps/server/src/modules/authentication/strategy/oauth2.strategy.spec.ts b/apps/server/src/modules/authentication/strategy/oauth2.strategy.spec.ts index d2e5a10202f..da8378a4176 100644 --- a/apps/server/src/modules/authentication/strategy/oauth2.strategy.spec.ts +++ b/apps/server/src/modules/authentication/strategy/oauth2.strategy.spec.ts @@ -89,7 +89,7 @@ describe('Oauth2Strategy', () => { userId: user.id as EntityId, roles: [user.roles[0].id], schoolId: user.schoolId, - accountId: account.id, + accountId: account.id ?? '', externalIdToken: idToken, isExternalUser: true, });