Skip to content

Commit d4ae367

Browse files
committed
update HelloWorld.test.tsx
1 parent 92d8435 commit d4ae367

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
import 'react'
22
import { $, expect } from '@wdio/globals'
3-
import { render, screen } from '@testing-library/react'
3+
import { render } 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.
99
render(<App />)
1010

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

1613
// Dispatch a native click event to our button element.
1714
await button.click()

0 commit comments

Comments
 (0)