Files
Janka UrygaandGitHub dfaf137b81 test: remove "@testing-library/jest-dom" from default jest setup (#78157)
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.
2025-04-14 22:02:25 +02:00

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')
})