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

Commit d14721c

Browse files
committed
test(circular-progress): refactor circular progress
1 parent 7b3d85f commit d14721c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

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

44
const renderComponent = (props) => {
55
const base = {
@@ -20,26 +20,26 @@ it('should render correctly', () => {
2020
})
2121

2222
it('should display a label', () => {
23-
const { queryByText } = renderComponent({
23+
renderComponent({
2424
template: `
2525
<CCircularProgress :value="40">
2626
<CCircularProgressLabel>40%</CCircularProgressLabel>
2727
</CCircularProgress>`
2828
})
2929

30-
expect(queryByText('40%')).toBeInTheDocument()
30+
expect(screen.getByText('40%')).toBeInTheDocument()
3131
})
3232

3333
test('a11y - progress has a "role" set to "progressbar"', () => {
34-
const { queryByRole } = renderComponent()
34+
renderComponent()
3535

36-
expect(queryByRole('progressbar')).toBeInTheDocument()
36+
expect(screen.queryByRole('progressbar')).toBeInTheDocument()
3737
})
3838

3939
test('a11y - progress has a "aria-valuenow" set to the percentage completion value', () => {
40-
const { queryByTestId } = renderComponent()
40+
renderComponent()
4141

42-
expect(queryByTestId('CircularProgress')).toHaveAttribute(
42+
expect(screen.queryByTestId('CircularProgress')).toHaveAttribute(
4343
'aria-valuenow',
4444
'40'
4545
)

0 commit comments

Comments
 (0)