Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
mxrcury committed Sep 26, 2023
1 parent 6a18ebf commit dcfb28f
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions tests/unit/components/question/Question.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@ import { screen, render } from '@testing-library/react'
import Question from '~/components/question/Question'

const mockedQuestion = {
title: 'Philosophy',
answers: [
{
id: '1',
text: 'Buddha Shakyamuni',
isCorrect: true
},
{
id: '2',
text: 'Jordan Belfort',
isCorrect: false
}
],
text: 'Who created buddhism?',
question: {
title: 'About Philosophy',
items: [
{
id: '1',
text: 'Buddha Shakyamuni',
isCorrect: true
},
{
id: '2',
text: 'Jordan Belfort',
isCorrect: false
}
],
text: 'Who created buddhism?',
id: '1'
},
category: {
_id: 'some-text-id-123',
name: 'Philosophy'
},
id: '1'
}
}

describe('Question', () => {
Expand All @@ -29,7 +31,7 @@ describe('Question', () => {
})

it('render question text', () => {
const questionText = screen.getByText(mockedQuestion.text)
const questionText = screen.getByText(mockedQuestion.question.text)

expect(questionText).toBeInTheDocument()
})
Expand Down

0 comments on commit dcfb28f

Please sign in to comment.