diff --git a/gatewayservice/gateway-service.test.js b/gatewayservice/gateway-service.test.js index 539c773d..b017d574 100644 --- a/gatewayservice/gateway-service.test.js +++ b/gatewayservice/gateway-service.test.js @@ -38,18 +38,12 @@ describe('Gateway Service', () => { expect(response.body.userId).toBe('mockedUserId'); }); it('should forward create question request to question generation service', async () => { - const mockedQuestionData = { - question: expect.any(String), - correct: expect.any(String), - incorrects: expect.any(Array) - }; - - axios.get.mockResolvedValue({ data: mockedQuestionData }); - const response = await request(app) .get('/api/questions/create'); expect(response.statusCode).toBe(200); - expect(response.body).toEqual(expect.objectContaining(mockedQuestionData)); + expect(response.body).toHaveProperty('question'); + expect(response.body).toHaveProperty('correct'); + expect(response.body).toHaveProperty('incorrects'); }); }); \ No newline at end of file