Skip to content

Commit

Permalink
Update Dialog test to use getByRole for close button
Browse files Browse the repository at this point in the history
  • Loading branch information
dlnr committed May 10, 2024
1 parent 4cd305b commit f978a60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/Dialog/Dialog.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ describe('Dialog', () => {
it('renders DialogClose button', () => {
render(<Dialog open />)

const closeButton = screen.getByText('Sluiten')
const closeButton = screen.getByRole('button', { name: 'Sluiten' })

expect(closeButton).toBeInTheDocument()
})

it('renders a custom close label', () => {
render(<Dialog open closeButtonLabel="Close" />)

const closeButton = screen.getByText('Close')
const closeButton = screen.getByRole('button', { name: 'Close' })

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

0 comments on commit f978a60

Please sign in to comment.