From fdbffcdaa48909fdbdf197bdf3023f4195a4bb07 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Thu, 30 Jul 2026 08:49:45 +0800 Subject: [PATCH] test(timeline): add smoke test for TimeRuler --- .../components/timeline/TimeRuler.test.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 apps/web/src/test/pages/editing-planner/components/timeline/TimeRuler.test.tsx diff --git a/apps/web/src/test/pages/editing-planner/components/timeline/TimeRuler.test.tsx b/apps/web/src/test/pages/editing-planner/components/timeline/TimeRuler.test.tsx new file mode 100644 index 000000000..f3c2645aa --- /dev/null +++ b/apps/web/src/test/pages/editing-planner/components/timeline/TimeRuler.test.tsx @@ -0,0 +1,19 @@ +import { describe, expect, it, vi } from "vitest" +import { render } from "@testing-library/react" +import { TimeRuler } from "@/pages/editing-planner/components/timeline/TimeRuler" + +vi.mock("@/pages/editing-planner/utils/timeline", () => ({ + generateRulerMarks: () => [0, 30, 60], +})) + +vi.mock("@/pages/editing-planner/constants/timeline", () => ({ + getRulerStep: () => 10, + MIN_TRACK_WIDTH: 1800, +})) + +describe("TimeRuler", () => { + it("renders without crashing", () => { + const { container } = render() + expect(container).toBeTruthy() + }) +})