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

Commit 7a488ef

Browse files
committed
test(button-group): refactor use screen
1 parent 1cf9673 commit 7a488ef

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

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

44
const renderComponent = (props) => {
55
const base = {
@@ -23,21 +23,21 @@ it('should render correctly', () => {
2323
})
2424

2525
it('should attach buttons when `is-attached` is passed', () => {
26-
const { asFragment, getByText } = renderComponent({
26+
const { asFragment } = renderComponent({
2727
template: `
2828
<CButtonGroup isAttached>
2929
<CButton>Button1</CButton>
3030
<CButton>Button2</CButton>
3131
</CButtonGroup>`
3232
})
3333

34-
const button = getByText('Button1')
34+
const button = screen.getByText('Button1')
3535
expect(button).toHaveStyle('border-top-right-radius: 0; border-bottom-right-radius: 0;')
3636
expect(asFragment()).toMatchSnapshot()
3737
})
3838

3939
it('should display children', () => {
40-
const { getByText } = renderComponent()
41-
expect(getByText('Button1')).toBeInTheDocument()
42-
expect(getByText('Button2')).toBeInTheDocument()
40+
renderComponent()
41+
expect(screen.getByText('Button1')).toBeInTheDocument()
42+
expect(screen.getByText('Button2')).toBeInTheDocument()
4343
})

0 commit comments

Comments
 (0)