From 5cf439e6c0605b13a4bb86ac18afff517dbd7ec6 Mon Sep 17 00:00:00 2001 From: Valur Einarsson Date: Tue, 14 Jan 2025 14:21:50 +0000 Subject: [PATCH] Fix tests. --- .../delegation-index/delegation-index.controller.spec.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/services/auth/delegation-api/src/app/delegations/test/delegation-index/delegation-index.controller.spec.ts b/apps/services/auth/delegation-api/src/app/delegations/test/delegation-index/delegation-index.controller.spec.ts index f29af9973922..803c49eb0f9d 100644 --- a/apps/services/auth/delegation-api/src/app/delegations/test/delegation-index/delegation-index.controller.spec.ts +++ b/apps/services/auth/delegation-api/src/app/delegations/test/delegation-index/delegation-index.controller.spec.ts @@ -1,4 +1,6 @@ import { getModelToken } from '@nestjs/sequelize' +import addYears from 'date-fns/addYears' +import kennitala from 'kennitala' import request from 'supertest' import { DelegationIndex } from '@island.is/auth-api-lib' @@ -15,8 +17,6 @@ import { import { TestApp } from '@island.is/testing/nest' import { setupWithAuth } from '../../../../../test/setup' -import kennitala from 'kennitala' -import addYears from 'date-fns/addYears' const path = '/v1/delegation-index/.id' const testNationalId = createNationalId('person') @@ -423,6 +423,7 @@ describe('DelegationIndexController', () => { describe('PUT for Legal guardians', () => { let app: TestApp let server: request.SuperTest + let factory: FixtureFactory let delegationIndexModel: typeof DelegationIndex const delegationProvider = AuthDelegationProvider.NationalRegistry @@ -439,6 +440,8 @@ describe('DelegationIndexController', () => { server = request(app.getHttpServer()) delegationIndexModel = app.get(getModelToken(DelegationIndex)) + factory = new FixtureFactory(app) + await factory.createAllDelegationTypes() }) afterAll(async () => {