mirror of
https://github.com/langgenius/dify.git
synced 2026-07-27 23:18:33 +08:00
17 lines
493 B
TypeScript
17 lines
493 B
TypeScript
import { render, screen } from '@testing-library/react'
|
|
import userEvent from '@testing-library/user-event'
|
|
import SVGBtn from '..'
|
|
|
|
describe('SVGBtn', () => {
|
|
it('toggles SVG mode when clicked', async () => {
|
|
const user = userEvent.setup()
|
|
const setIsSVG = vi.fn()
|
|
render(<SVGBtn isSVG={false} setIsSVG={setIsSVG} />)
|
|
|
|
await user.click(screen.getByRole('button'))
|
|
|
|
expect(setIsSVG).toHaveBeenCalledOnce()
|
|
expect(setIsSVG.mock.calls[0]).toBe(true)
|
|
})
|
|
})
|