From bc6dc4c2291ac1c0446c69a32f8f3e2406db7d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fern=C3=A1ndez=20Noriega?= Date: Tue, 23 Apr 2024 17:33:36 +0200 Subject: [PATCH] Fixed question-service test to adapt to the new answer in question-service --- questionservice/question-service.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/questionservice/question-service.test.js b/questionservice/question-service.test.js index a416657..9f9454e 100644 --- a/questionservice/question-service.test.js +++ b/questionservice/question-service.test.js @@ -113,7 +113,7 @@ describe('Question Service', () => { }); //Test /imgs/answer endpoint (Incorrect answer) - it('should inform the answer is incorrect and what is the element associated to the answer', async () => { + it('should inform the answer is incorrect and what is the correct answer', async () => { //First I ask a question const response = await request(app).get('/imgs/foods/question'); regex = new RegExp(`Which of the following images corresponds to (\\w+)\\?`); @@ -135,7 +135,7 @@ describe('Question Service', () => { .set('Content-Type', 'application/json') .send({answer:incorrectImageAnswer, question:question, username:"username", category:"foods"}) expect(responseAnswer.body.correct).toBe("false") - expect(responseAnswer.body.associate).toBe(imgsToAssociatesMap.get(incorrectImageAnswer)) + expect(responseAnswer.body.correctImg).toBe([...imgsToAssociatesMap].find(([key, val]) => val == correctAnswerLabel)[0]) }); });