feat: streamline arbitrary audio sources

This commit is contained in:
Codex
2026-08-28 15:43:57 +09:00
parent b03eccde50
commit 9a7401c023
6 changed files with 103 additions and 35 deletions
+6 -5
View File
@@ -73,20 +73,21 @@ test("Dataset Builder 전체 저장·재연결 흐름이 동일한 scene과 prev
const staleSvg = '<svg xmlns="http://www.w3.org/2000/svg" width="320" height="240"><rect width="320" height="240" fill="#ff0000"/></svg>';
const staleImageFile = new windowObject.File([staleSvg], "stale.svg", { type: "image/svg+xml" });
dispatchFiles(windowObject, documentObject.querySelector("#audio-input"), [audioFile]);
dispatchFiles(windowObject, documentObject.querySelector("#audio-source-input"), [audioFile]);
await waitFor(
() => [...documentObject.querySelectorAll(".asset-chip__state")].some((item) => item.textContent === "연결됨"),
"오디오 hash/decode",
"오디오 파일 음원 생성",
);
await waitFor(() => documentObject.querySelectorAll(".source-card").length === 2, "asset source card");
assertEqual(documentObject.querySelector("#source-type").value, "asset", "import selects asset source");
assertEqual(documentObject.querySelector("#source-name").value, "machine", "source name comes from file");
assert(documentObject.querySelector("#source-asset").value !== "", "imported asset is selected");
dispatchFiles(windowObject, documentObject.querySelector("#image-input"), [staleImageFile]);
dispatchFiles(windowObject, documentObject.querySelector("#image-input"), [imageFile]);
await waitFor(() => documentObject.querySelectorAll(".asset-chip__state").length === 2, "이미지 decode");
await waitFor(() => documentObject.documentElement.dataset.assetsReady === "true", "asset 준비");
documentObject.querySelector("#add-source-button").click();
assertEqual(documentObject.querySelectorAll(".source-card").length, 2, "source card count");
dispatchValue(windowObject, documentObject.querySelector("#source-name"), "asset source");
dispatchValue(windowObject, documentObject.querySelector("#source-type"), "asset", "change");
dispatchChecked(windowObject, documentObject.querySelector("#source-loop"), true);
const canvas = documentObject.querySelector("#scene-canvas");