Files
dify/web/app/components/datasets/loading.spec.tsx
CodingOnStar 0f6befd0a2 test: add comprehensive tests for datasets components with 95%+ coverage
- Add tests for api-access/index.tsx (100% coverage)
- Enhance tests for operations.tsx (95.65% coverage)
- Enhance tests for status-item/index.tsx (93.75% coverage)
- Add tests for simple components: chunk, loading, preview, statistics, empty-folder, no-linked-apps-panel, api/index
- Remove tests for complex component retrieval-param-config
- Test operations: archive, unarchive, enable, disable, sync, pause, resume, delete, download, rename
- Test switch toggles with debounce handling
- Test error notifications and success callbacks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:42:43 +08:00

22 lines
533 B
TypeScript

import { cleanup, render } from '@testing-library/react'
import { afterEach, describe, expect, it } from 'vitest'
import DatasetsLoading from './loading'
afterEach(() => {
cleanup()
})
describe('DatasetsLoading', () => {
it('should render null', () => {
const { container } = render(<DatasetsLoading />)
expect(container.firstChild).toBeNull()
})
it('should not throw on multiple renders', () => {
expect(() => {
render(<DatasetsLoading />)
render(<DatasetsLoading />)
}).not.toThrow()
})
})