Files
moteva/frontend/tests/artboardPreview.test.mjs
T
root 9da13d2814 fix(canvas): label the generating skeleton with status, not the planned title
Show a localized "Generating" label on the artboard generation skeleton
while keeping the planned title as the aria-label, so in-progress nodes read
as a status instead of prematurely displaying their eventual name.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 09:07:37 +08:00

15 lines
674 B
JavaScript

import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";
test("shows generation status instead of the planned image title", async () => {
const [localeSource, componentSource] = await Promise.all([
readFile(new URL("../src/i18n/locales/zh-CN.json", import.meta.url), "utf8"),
readFile(new URL("../src/ui/components/ArtboardPreview/index.tsx", import.meta.url), "utf8")
]);
const locale = JSON.parse(localeSource);
assert.equal(locale.generatingImage, "正在生成中");
assert.match(componentSource, /GeneratingArtboardSkeleton ariaLabel=\{node\.title\} label=\{t\("generatingImage"\)\}/);
});