dify/web/app/components/datasets/preview/__tests__/index.spec.tsx
Coding On Star 10f85074e8
test: add comprehensive unit and integration tests for dataset module (#32187)
Co-authored-by: CodingOnStar <hanxujiang@dify.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 10:00:32 +08:00

26 lines
637 B
TypeScript

import { cleanup, render } from '@testing-library/react'
import { afterEach, describe, expect, it } from 'vitest'
import DatasetPreview from '../index'
afterEach(() => {
cleanup()
})
describe('DatasetPreview', () => {
it('should render null', () => {
const { container } = render(<DatasetPreview />)
expect(container.firstChild).toBeNull()
})
it('should be a valid function component', () => {
expect(typeof DatasetPreview).toBe('function')
})
it('should not throw on multiple renders', () => {
expect(() => {
render(<DatasetPreview />)
render(<DatasetPreview />)
}).not.toThrow()
})
})