Skip to content

Commit 3522eed

Browse files
committed
chore: adjust user event setup
1 parent fe483a9 commit 3522eed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/qwik-testing-library/example.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ import {Counter} from './counter'
2929
describe('<Counter />', () => {
3030
// describe the test case
3131
it('should increment the counter', async () => {
32+
// setup user event
33+
const user = userEvent.setup()
3234
// render the component into the DOM
3335
await render(<Counter />)
3436

3537
// retrieve the 'increment count' button
3638
const incrementBtn = screen.getByRole('button', {name: /increment count/})
3739
// click the button twice
38-
const user = userEvent.setup()
3940
await user.click(incrementBtn)
4041
await user.click(incrementBtn)
4142

0 commit comments

Comments
 (0)