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

Commit 70e9ae2

Browse files
committed
test(icon-button): refactor use screen
1 parent 5edf979 commit 70e9ae2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import CIconButton 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,15 +19,15 @@ it('should render correctly', () => {
1919

2020
it('should display spinner and hide the icon', () => {
2121
const inlineAttrs = 'isLoading'
22-
const { container, getByTestId } = renderComponent({ inlineAttrs })
22+
const { container } = renderComponent({ inlineAttrs })
2323

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

2626
expect(button).toHaveAttribute('disabled')
2727
expect(button).toHaveAttribute('aria-disabled', 'true')
2828

2929
// TODO: find a way to easily grab the spinner element
30-
// Maybe? expect(getByTestId('Spinner')).toBeInTheDocument()
30+
// Maybe? expect(screen.getByTestId('Spinner')).toBeInTheDocument()
3131
expect(button).toHaveStyle('opacity: 0.4')
3232
expect(container.querySelector('button > div')).toBeInTheDocument()
3333
})

0 commit comments

Comments
 (0)