Skip to content

Commit

Permalink
feat(radio): update test
Browse files Browse the repository at this point in the history
  • Loading branch information
oasis-cloud committed Nov 27, 2024
1 parent b93ff79 commit 75fdcc7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/packages/radio/__test__/radio.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import { render, fireEvent, screen } from '@testing-library/react'
import '@testing-library/jest-dom'
import { useState } from 'react'
import { fireEvent, render, screen } from '@testing-library/react'
import '@testing-library/jest-dom'
import { Checklist } from '@nutui/icons-react'
import Radio from '@/packages/radio'
import RadioGroup from '@/packages/radiogroup'
Expand All @@ -24,6 +24,17 @@ describe('radio', () => {
expect(container.querySelector('.nut-radio-self-checked')).toBeTruthy()
})

test('radio checked-disabled', () => {
const { container } = render(
<Radio checked disabled>
Test Case
</Radio>
)
expect(
container.querySelector('.nut-radio-self-checked-disabled')
).toBeTruthy()
})

test('radio custom icon', () => {
const { container } = render(
<Radio icon={<Checklist />} activeIcon={<Checklist />}>
Expand Down

0 comments on commit 75fdcc7

Please sign in to comment.