mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 19:27:23 +08:00
24 lines
845 B
TypeScript
24 lines
845 B
TypeScript
import { render, screen } from '@testing-library/react'
|
|
import { describe, expect, it } from 'vitest'
|
|
import VideoGallery from './index'
|
|
|
|
describe('VideoGallery', () => {
|
|
const mockSrcs = ['video1.mp4', 'video2.mp4']
|
|
|
|
it('should render nothing when srcs is empty', () => {
|
|
const { container } = render(<VideoGallery srcs={[]} />)
|
|
expect(container).toBeEmptyDOMElement()
|
|
})
|
|
|
|
it('should render nothing when all srcs are empty strings', () => {
|
|
const { container } = render(<VideoGallery srcs={['', '']} />)
|
|
expect(container).toBeEmptyDOMElement()
|
|
})
|
|
|
|
it('should render VideoPlayer when valid srcs are provided', () => {
|
|
render(<VideoGallery srcs={mockSrcs} />)
|
|
expect(screen.getByTestId('video-gallery-container')).toBeInTheDocument()
|
|
expect(screen.getByTestId('video-element')).toBeInTheDocument()
|
|
})
|
|
})
|