mirror of
https://github.com/langgenius/dify.git
synced 2026-05-02 00:18:03 +08:00
- 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>
25 lines
678 B
TypeScript
25 lines
678 B
TypeScript
import { cleanup, render, screen } from '@testing-library/react'
|
|
import { afterEach, describe, expect, it } from 'vitest'
|
|
import ApiIndex from './index'
|
|
|
|
afterEach(() => {
|
|
cleanup()
|
|
})
|
|
|
|
describe('ApiIndex', () => {
|
|
it('should render without crashing', () => {
|
|
render(<ApiIndex />)
|
|
expect(screen.getByText('index')).toBeInTheDocument()
|
|
})
|
|
|
|
it('should render a div with text "index"', () => {
|
|
const { container } = render(<ApiIndex />)
|
|
expect(container.firstChild).toBeInstanceOf(HTMLDivElement)
|
|
expect(container.textContent).toBe('index')
|
|
})
|
|
|
|
it('should be a valid function component', () => {
|
|
expect(typeof ApiIndex).toBe('function')
|
|
})
|
|
})
|