Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 2d8b646

Browse files
committed
test(text): refactor use screen
1 parent a6cf7ef commit 2d8b646

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/chakra-ui-core/src/CText/tests/CText.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import CText from '..'
2-
import { render } from '@/tests/test-utils'
2+
import { render, screen } from '@/tests/test-utils'
33

44
const renderComponent = (props) => {
55
const inlineAttrs = (props && props.inlineAttrs) || ''
@@ -19,9 +19,9 @@ it('should render correctly', () => {
1919

2020
it('should change the style', () => {
2121
const inlineAttrs = 'd="flex"'
22-
const { asFragment, getByTestId } = renderComponent({ inlineAttrs })
22+
const { asFragment } = renderComponent({ inlineAttrs })
2323

24-
const text = getByTestId('text')
24+
const text = screen.getByTestId('text')
2525

2626
expect(asFragment()).toMatchSnapshot()
2727
expect(text).toHaveStyle('display: flex')
@@ -44,8 +44,8 @@ it.each`
4444
'should display text type as $as',
4545
({ as }) => {
4646
const inlineAttrs = `as=${as}`
47-
const { getByTestId } = renderComponent({ inlineAttrs })
48-
const text = getByTestId('text')
47+
renderComponent({ inlineAttrs })
48+
const text = screen.getByTestId('text')
4949
expect(text.tagName.toLowerCase()).toEqual(as)
5050
}
5151
)

0 commit comments

Comments
 (0)