Skip to content

Commit

Permalink
Make DOJO exercises tests pass after fixing React key bug
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanjenningz committed Sep 21, 2022
1 parent 8fac01b commit 3a6f6a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __dummy__/getExercisesData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const getExercisesData: GetExercisesQuery = {
},
description: '```\nlet a = 1\na -= 2\n// what is a?\n```',
answer: '-1',
explanation: '`a -= 2` is a shorter way to write `a = a - 2`'
explanation: null
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion __tests__/pages/exercises/[lessonSlug].test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ describe('Exercises page', () => {
// Previous button is not in the document on the first exercise.
expect(queryByRole('button', { name: 'PREVIOUS' })).not.toBeInTheDocument()

const skipButton = getByRole('button', { name: 'SKIP' })
let skipButton = getByRole('button', { name: 'SKIP' })
fireEvent.click(skipButton)
expect(queryByRole('button', { name: 'PREVIOUS' })).toBeInTheDocument()

skipButton = getByRole('button', { name: 'SKIP' })
fireEvent.click(skipButton)
// Skip button should not be in the document because we're on the last exercise now.
expect(queryByRole('button', { name: 'SKIP' })).not.toBeInTheDocument()
Expand Down

0 comments on commit 3a6f6a6

Please sign in to comment.