|
1 | 1 | import { CButton, CRadioButtonGroup } from '../..'
|
2 |
| -import { render } from '@/tests/test-utils' |
| 2 | +import { render, screen } from '@/tests/test-utils' |
3 | 3 |
|
4 | 4 | const CustomRadio = {
|
5 | 5 | name: 'CustomRadio',
|
@@ -55,29 +55,29 @@ it('should render correctly', () => {
|
55 | 55 | })
|
56 | 56 |
|
57 | 57 | it('should display children', () => {
|
58 |
| - const { getByText } = renderComponent() |
59 |
| - expect(getByText('Custom Radio 1')).toBeInTheDocument() |
60 |
| - expect(getByText('Custom Radio 2')).toBeInTheDocument() |
| 58 | + renderComponent() |
| 59 | + expect(screen.getByText('Custom Radio 1')).toBeInTheDocument() |
| 60 | + expect(screen.getByText('Custom Radio 2')).toBeInTheDocument() |
61 | 61 | })
|
62 | 62 |
|
63 | 63 | test('v-model works', () => {
|
64 |
| - const { getByTestId } = renderComponent({ |
| 64 | + renderComponent({ |
65 | 65 | data () {
|
66 | 66 | return {
|
67 | 67 | selected: 'item-2'
|
68 | 68 | }
|
69 | 69 | }
|
70 | 70 | })
|
71 |
| - const one = getByTestId('item-1') |
72 |
| - const two = getByTestId('item-2') |
| 71 | + const one = screen.getByTestId('item-1') |
| 72 | + const two = screen.getByTestId('item-2') |
73 | 73 |
|
74 | 74 | expect(one).not.toHaveAttribute('aria-checked')
|
75 | 75 | expect(two).toHaveAttribute('aria-checked', 'true')
|
76 | 76 | })
|
77 | 77 |
|
78 | 78 | test('CustomRadio isDisabled works', () => {
|
79 |
| - const { getByTestId } = renderComponent() |
80 |
| - const last = getByTestId('item-4') |
| 79 | + renderComponent() |
| 80 | + const last = screen.getByTestId('item-4') |
81 | 81 |
|
82 | 82 | expect(last).toHaveAttribute('disabled')
|
83 | 83 | })
|
0 commit comments