Skip to content

Commit

Permalink
Fixed question-service test to adapt to the new answer in question-se…
Browse files Browse the repository at this point in the history
…rvice
  • Loading branch information
ChristianFN2 committed Apr 23, 2024
1 parent 33d4975 commit bc6dc4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions questionservice/question-service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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+)\\?`);
Expand All @@ -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])
});
});

Expand Down

0 comments on commit bc6dc4c

Please sign in to comment.