feat(canvas): 自由画布 - 增强空白起点、外观设置与节点连接体验 (#356)
This commit is contained in:
21
web/test/canvas-starter.test.ts
Normal file
21
web/test/canvas-starter.test.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
|
||||
import { resolveCanvasEmptyStateKind } from "../src/lib/canvas/canvas-starter";
|
||||
|
||||
describe("canvas starter", () => {
|
||||
test("offers the guided entry for a new short-drama canvas", () => {
|
||||
expect(resolveCanvasEmptyStateKind({ nodeCount: 0, shortDramaEnabled: true, isProjectLinked: false })).toBe("guided");
|
||||
});
|
||||
|
||||
test("persists the freeform choice while the canvas remains empty", () => {
|
||||
expect(resolveCanvasEmptyStateKind({ nodeCount: 0, shortDramaEnabled: true, isProjectLinked: false, starterMode: "freeform" })).toBe("freeform");
|
||||
});
|
||||
|
||||
test("keeps linked projects on their project-specific empty state", () => {
|
||||
expect(resolveCanvasEmptyStateKind({ nodeCount: 0, shortDramaEnabled: true, isProjectLinked: true, starterMode: "freeform" })).toBe("linked");
|
||||
});
|
||||
|
||||
test("hides every starter after the first node is created", () => {
|
||||
expect(resolveCanvasEmptyStateKind({ nodeCount: 1, shortDramaEnabled: true, isProjectLinked: false, starterMode: "freeform" })).toBe("none");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user