feat(*): 分镜与资产 - 完善五类资产、候选去重、搜索、中文镜头编号与分类整理
This commit is contained in:
22
web/test/shot-label.test.ts
Normal file
22
web/test/shot-label.test.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
|
||||
import { customShotTitle, formatShotOrdinal, normalizeDefaultShotTitle } from "@/lib/shot-label";
|
||||
|
||||
describe("shot labels", () => {
|
||||
test("使用中文两位镜头编号", () => {
|
||||
expect(formatShotOrdinal(0)).toBe("镜头01");
|
||||
expect(formatShotOrdinal(11)).toBe("镜头12");
|
||||
});
|
||||
|
||||
test("只转换精确匹配的历史默认标题", () => {
|
||||
expect(normalizeDefaultShotTitle("SC.01", 0)).toBe("镜头01");
|
||||
expect(normalizeDefaultShotTitle("SC.01 雨夜", 0)).toBe("SC.01 雨夜");
|
||||
expect(normalizeDefaultShotTitle("雨夜追逐", 0)).toBe("雨夜追逐");
|
||||
});
|
||||
|
||||
test("默认标题不会在编号旁重复展示", () => {
|
||||
expect(customShotTitle("SC.01", 0)).toBe("");
|
||||
expect(customShotTitle("镜头01", 0)).toBe("");
|
||||
expect(customShotTitle("雨夜追逐", 0)).toBe("雨夜追逐");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user