Skip to content

Commit 92d8435

Browse files
committed
updates based on docs
1 parent e3ca326 commit 92d8435

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

react-typescript-vite/src/tests/HelloWorld.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import 'react'
22
import { $, expect } from '@wdio/globals'
3-
import { render } from '@testing-library/react'
3+
import { render, screen } from '@testing-library/react'
44
import App from '../App'
55

66
describe('React Component Testing', () => {
77
it('increments value on click', async () => {
88
// The render method returns a collection of utilities to query your component.
9-
const { getByText } = render(<App />)
9+
render(<App />)
1010

1111
// getByText returns the first matching node for the provided text, and
1212
// throws an error if no elements match or if more than one match is found.
13-
const btn = getByText('count is 0')
14-
const button = await $(btn)
13+
const btn = screen.getByText('count is 0')
14+
const button = $(btn)
1515

1616
// Dispatch a native click event to our button element.
1717
await button.click()

0 commit comments

Comments
 (0)