This repository was archived by the owner on Sep 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/chakra-ui-core/src/CButtonGroup/tests Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
import { CButton , CButtonGroup } from '../..'
2
- import { render } from '@/tests/test-utils'
2
+ import { render , screen } from '@/tests/test-utils'
3
3
4
4
const renderComponent = ( props ) => {
5
5
const base = {
@@ -23,21 +23,21 @@ it('should render correctly', () => {
23
23
} )
24
24
25
25
it ( 'should attach buttons when `is-attached` is passed' , ( ) => {
26
- const { asFragment, getByText } = renderComponent ( {
26
+ const { asFragment } = renderComponent ( {
27
27
template : `
28
28
<CButtonGroup isAttached>
29
29
<CButton>Button1</CButton>
30
30
<CButton>Button2</CButton>
31
31
</CButtonGroup>`
32
32
} )
33
33
34
- const button = getByText ( 'Button1' )
34
+ const button = screen . getByText ( 'Button1' )
35
35
expect ( button ) . toHaveStyle ( 'border-top-right-radius: 0; border-bottom-right-radius: 0;' )
36
36
expect ( asFragment ( ) ) . toMatchSnapshot ( )
37
37
} )
38
38
39
39
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 ( )
43
43
} )
You can’t perform that action at this time.
0 commit comments