Files
Dev-Landing/tests/landing-content.test.mjs

33 lines
920 B
JavaScript

import { readFile } from "node:fs/promises";
import test from "node:test";
import assert from "node:assert/strict";
const componentPath = new URL("../src/components/canva-landing.tsx", import.meta.url);
test("Canva landing component contains the core brief anchors", async () => {
const source = await readFile(componentPath, "utf8");
for (const phrase of ["Projektbrief", "01", "Website", "Kontakt", "für", "müssen", "Änderungen"]) {
assert.match(source, new RegExp(phrase));
}
});
test("Canva landing component uses real German umlauts in visible copy", async () => {
const source = await readFile(componentPath, "utf8");
for (const asciiFallback of [
"fuer",
"muessen",
"spaetere",
"Aenderungen",
"glaubwuerdig",
"naechste",
"Agenturlaerm",
"Erzaehlen",
"Saetze",
"Rueckmeldung",
]) {
assert.doesNotMatch(source, new RegExp(asciiFallback));
}
});