Skip to content

Commit

Permalink
Remove back to home button when finished test
Browse files Browse the repository at this point in the history
  • Loading branch information
leung018 committed Jul 29, 2024
1 parent 59471ff commit c754a88
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
11 changes: 0 additions & 11 deletions src/app/components/quiz.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,6 @@ describe('MultipleChoiceQuiz', () => {
expect(await findByText('Your score: 1/2')).toBeVisible()
})

it('should display back to home page button only after submit button is clicked', async () => {
const {
renderResult: { queryByRole, getByText, findByRole },
} = renderMultipleChoicePage()

expect(queryByRole('button', { name: 'Back' })).toBeNull()
fireEvent.click(getByText('Submit'))

expect(await findByRole('button', { name: 'Back' })).toBeVisible()
})

it('should submit button and choices are disabled after submitting', async () => {
const {
renderResult: { getByText, getByLabelText },
Expand Down
8 changes: 0 additions & 8 deletions src/app/components/quiz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,6 @@ function MultipleChoiceQuiz({
<p className="font-bold">
Your score: {score}/{questionSet.questions.length}
</p>
<button
className="bg-green-500 text-white font-bold py-2 px-4 rounded mt-4"
onClick={() => {
router.push('/')
}}
>
Back
</button>
</div>
)}
</div>
Expand Down

0 comments on commit c754a88

Please sign in to comment.