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

Commit b58b5f7

Browse files
committed
test(pseudo-box): refactor use screen
1 parent 4ad841f commit b58b5f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

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

44
const renderComponent = (props) => {
55
const inlineAttrs = (props && props.inlineAttrs) || ''
@@ -21,9 +21,9 @@ it('should change the style', () => {
2121
d="flex" :w="['auto']" px="5" py="5" shadow="lg"
2222
my="5" mb="5" rounded="sm" font-family="body"
2323
background-color="blue.200" color="blue.700"`
24-
const { asFragment, getByTestId } = renderComponent({ inlineAttrs })
24+
const { asFragment } = renderComponent({ inlineAttrs })
2525

26-
const pseudobox = getByTestId('pseudobox')
26+
const pseudobox = screen.getByTestId('pseudobox')
2727

2828
expect(asFragment()).toMatchSnapshot()
2929
expect(pseudobox).toHaveStyle('display: flex')
@@ -46,8 +46,8 @@ it.each`
4646
'should display Box with type as $as',
4747
({ as }) => {
4848
const inlineAttrs = `as=${as}`
49-
const { asFragment, getByTestId } = renderComponent({ inlineAttrs })
50-
expect(getTagName(getByTestId('pseudobox'))).toEqual(as)
49+
const { asFragment } = renderComponent({ inlineAttrs })
50+
expect(getTagName(screen.getByTestId('pseudobox'))).toEqual(as)
5151
expect(asFragment()).toMatchSnapshot()
5252
}
5353
)

0 commit comments

Comments
 (0)