From d5bd77495f1b7e3b0345ade99cfcec666a43607a Mon Sep 17 00:00:00 2001 From: Aleksandr Tereshchenko Date: Wed, 18 Dec 2024 15:23:10 +0200 Subject: [PATCH] Fix integration tests --- src/server/routes/programManagement.integration-test.js | 4 ++-- src/server/routes/thesisHelpers.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/routes/programManagement.integration-test.js b/src/server/routes/programManagement.integration-test.js index 5001882a..6fc71535 100644 --- a/src/server/routes/programManagement.integration-test.js +++ b/src/server/routes/programManagement.integration-test.js @@ -105,7 +105,7 @@ describe('program-managements router', () => { describe('GET /api/program-managements', () => { it('should return 200', async () => { const response = await request - .get('/api/program-managements') + .get('/api/program-managements?limitToEditorsPrograms=true') .set({ uid: user1.id, hygroupcn: 'hy-employees' }) expect(response.status).toEqual(200) expect(response.body).toMatchObject([]) @@ -293,7 +293,7 @@ describe('program-managements router', () => { describe('GET /api/program-managements', () => { it('should return 200 and only the programs that teacher is managing', async () => { const response = await request - .get('/api/program-managements') + .get('/api/program-managements?limitToEditorsPrograms=true') .set({ uid: user1.id, hygroupcn: 'hy-employees' }) expect(response.status).toEqual(200) expect(response.body).toIncludeSameMembers([ diff --git a/src/server/routes/thesisHelpers.ts b/src/server/routes/thesisHelpers.ts index 76a6d68b..82af7333 100644 --- a/src/server/routes/thesisHelpers.ts +++ b/src/server/routes/thesisHelpers.ts @@ -348,7 +348,7 @@ export const handleThesisCreationEmail = async ( newThesis: ThesisData, actionUser: UserType ) => { - if (newThesis.approvers.length) { + if (newThesis.approvers?.length) { const approverTargets = newThesis.approvers .filter((approver) => approver.email) .map((approver) => approver.email)