mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 15:08:06 +08:00
- Introduced new test files for ChunkLabel, ChunkContainer, QAPreview, DatasetsLoading, NoLinkedAppsPanel, ApiIndex, and several document-related components. - Enhanced test coverage by validating rendering, user interactions, and edge cases for each component. - Ensured proper functionality of user interactions, such as rendering conditions and state management, improving the reliability and maintainability of dataset-related features.
22 lines
534 B
TypeScript
22 lines
534 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()
|
|
})
|
|
})
|