feat: add flexible character uploads and video asset library

This commit is contained in:
xuejianwu
2026-08-05 16:27:16 +08:00
parent 77dc339f87
commit 93b12bf739
6 changed files with 331 additions and 71 deletions

View File

@@ -32,3 +32,14 @@ test("生成时长提供 5 到 14 秒全部整数选项", () => {
const values = [...durationSelect.matchAll(/<option value="(\d+)">/g)].map((match) => Number(match[1]));
assert.deepEqual(values, [5, 6, 7, 8, 9, 10, 11, 12, 13, 14]);
});
test("人物素材支持任选 1 到 3 张,且提供独立视频素材库", () => {
const html = readFileSync(new URL("../public/index.html", import.meta.url), "utf8");
assert.match(html, /data-module="video-library"/);
assert.match(html, /id="videoAssetForm"/);
for (const id of ["assetFrontUrl", "assetSideUrl", "assetBackUrl"]) {
const input = html.match(new RegExp(`<input id="${id}"[^>]*>`))?.[0] || "";
assert.ok(input, `缺少 ${id}`);
assert.doesNotMatch(input, /\srequired(?:\s|>)/);
}
});