From c3bcd04146098fe77ce88769e6cd788bd63b6126 Mon Sep 17 00:00:00 2001 From: Aleksandr Tereshchenko Date: Thu, 12 Dec 2024 15:57:09 +0200 Subject: [PATCH] Fix integration tests --- src/server/routes/thesis.integration-test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/routes/thesis.integration-test.js b/src/server/routes/thesis.integration-test.js index 32954c1..ec4b961 100644 --- a/src/server/routes/thesis.integration-test.js +++ b/src/server/routes/thesis.integration-test.js @@ -1633,7 +1633,7 @@ describe('thesis router', () => { }) }) - it('should return 403, and not log the event', async () => { + it('should return 201, and log the event', async () => { const response = await request .post('/api/theses') .set({ uid: user2.id, hygroupcn: 'hy-employees' }) @@ -1652,12 +1652,12 @@ describe('thesis router', () => { ) ) .field('json', JSON.stringify(newThesis)) - expect(response.status).toEqual(403) + expect(response.status).toEqual(201) const eventLog = await EventLog.findOne({ - where: { type: 'THESIS_CREATED' }, + where: { type: 'THESIS_CREATED', thesisId: response.body.id }, }) - expect(eventLog).toBeNull() + expect(eventLog).not.toBeNull() }) }) }) @@ -3148,7 +3148,7 @@ describe('thesis router', () => { }) }) - it('should return 403 status code', async () => { + it('should return 200 status code', async () => { const response = await request .put(`/api/theses/${thesis1.id}`) .set({ uid: user2.id, hygroupcn: 'hy-employees' }) @@ -3168,7 +3168,7 @@ describe('thesis router', () => { ) .field('json', JSON.stringify(updatedThesis)) - expect(response.status).toEqual(403) + expect(response.status).toEqual(200) }) }) })