mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
We aren't using `'@testing-library/jest-dom'` in 99% of the tests, so there's no point loading it for every test. I've removed it from `jest-setup-after-env` and added the import manually to each file that uses it.
14 lines
411 B
React
14 lines
411 B
React
/**
|
|
* @jest-environment jsdom
|
|
*/
|
|
import { fireEvent, render, screen } from '@testing-library/react'
|
|
import '@testing-library/jest-dom'
|
|
import Component from './component'
|
|
|
|
it('works with client-only code', () => {
|
|
render(<Component />)
|
|
expect(screen.getByRole('heading')).toHaveTextContent('0')
|
|
fireEvent.click(screen.getByRole('button'))
|
|
expect(screen.getByRole('heading')).toHaveTextContent('1')
|
|
})
|