test(timeline): add smoke test for ClipCard
CI/CD Pipeline / Check if frontend-only change (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / PR Build API Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Web Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Staging API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been cancelled
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Approve on CI Green (pull_request) Has been cancelled
Preview Deploy / Deploy Preview Environment (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled

This commit is contained in:
2026-07-30 08:49:42 +08:00
parent 90626e989c
commit 589fa828e0
@@ -0,0 +1,37 @@
import { describe, expect, it, vi } from "vitest"
import { render } from "@testing-library/react"
import { ClipCard } from "@/pages/editing-planner/components/timeline/ClipCard"
vi.mock("@ant-design/icons", () => ({
AudioOutlined: () => null,
VideoCameraOutlined: () => null,
PictureOutlined: () => null,
FontColorsOutlined: () => null,
MusicOutlined: () => null,
ScissorOutlined: () => null,
}))
const mockClip = {
id: "clip-1",
type: "voice",
duration: 10,
startOffset: 0,
} as any
describe("ClipCard", () => {
it("renders without crashing", () => {
const { container } = render(
<ClipCard
clip={mockClip}
isSelected={true}
pixelsPerSecond={30}
onSelect={vi.fn()}
onRemove={vi.fn()}
onTrimStart={vi.fn()}
onTrimEnd={vi.fn()}
onSplit={vi.fn()}
/>,
)
expect(container).toBeTruthy()
})
})