mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 01:18:05 +08:00
23 lines
763 B
TypeScript
23 lines
763 B
TypeScript
import { render } from '@testing-library/react'
|
|
import LoadingAnim from './index'
|
|
|
|
describe('LoadingAnim', () => {
|
|
it('should render correctly with text type', () => {
|
|
const { container } = render(<LoadingAnim type="text" />)
|
|
const element = container.firstChild as HTMLElement
|
|
|
|
expect(element).toBeInTheDocument()
|
|
expect(element.className).toMatch(/dot-flashing/)
|
|
expect(element.className).toMatch(/text/)
|
|
})
|
|
|
|
it('should render correctly with avatar type', () => {
|
|
const { container } = render(<LoadingAnim type="avatar" />)
|
|
const element = container.firstChild as HTMLElement
|
|
|
|
expect(element).toBeInTheDocument()
|
|
expect(element.className).toMatch(/dot-flashing/)
|
|
expect(element.className).toMatch(/avatar/)
|
|
})
|
|
})
|