Files
moteva/frontend/tests/artboardPreview.test.mjs
T

15 lines
674 B
JavaScript
Raw Normal View History

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"\)\}/);
});