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 +4
-4
lines changed
packages/chakra-ui-core/src/CIconButton/tests Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
import CIconButton 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 inlineAttrs = ( props && props . inlineAttrs ) || ''
@@ -19,15 +19,15 @@ it('should render correctly', () => {
19
19
20
20
it ( 'should display spinner and hide the icon' , ( ) => {
21
21
const inlineAttrs = 'isLoading'
22
- const { container, getByTestId } = renderComponent ( { inlineAttrs } )
22
+ const { container } = renderComponent ( { inlineAttrs } )
23
23
24
- const button = getByTestId ( 'btn' )
24
+ const button = screen . getByTestId ( 'btn' )
25
25
26
26
expect ( button ) . toHaveAttribute ( 'disabled' )
27
27
expect ( button ) . toHaveAttribute ( 'aria-disabled' , 'true' )
28
28
29
29
// TODO: find a way to easily grab the spinner element
30
- // Maybe? expect(getByTestId('Spinner')).toBeInTheDocument()
30
+ // Maybe? expect(screen. getByTestId('Spinner')).toBeInTheDocument()
31
31
expect ( button ) . toHaveStyle ( 'opacity: 0.4' )
32
32
expect ( container . querySelector ( 'button > div' ) ) . toBeInTheDocument ( )
33
33
} )
You can’t perform that action at this time.
0 commit comments