9da13d2814
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>
15 lines
674 B
JavaScript
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"\)\}/);
|
|
});
|