diff --git a/ApiCore-Frontend/src/lib/label-templates/placeholder-keys.spec.ts b/ApiCore-Frontend/src/lib/label-templates/placeholder-keys.spec.ts index e0fe0ad..a4b6751 100644 --- a/ApiCore-Frontend/src/lib/label-templates/placeholder-keys.spec.ts +++ b/ApiCore-Frontend/src/lib/label-templates/placeholder-keys.spec.ts @@ -1,19 +1,25 @@ -import { readFileSync } from "node:fs"; +import { existsSync, readFileSync } from "node:fs"; import path from "node:path"; import { describe, expect, it } from "vitest"; import { PLACEHOLDER_KEYS, PLACEHOLDER_LABELS } from "./placeholder-keys"; -describe("placeholder keys", () => { - it("the frontend list equals the backend fixture ApiCore-Backend/test/fixtures/placeholder-keys.json", () => { - // The monorepo sits next to the frontend; vitest runs from ApiCore-Frontend. - const fixture = path.resolve( - process.cwd(), - "../ApiCore-Backend/test/fixtures/placeholder-keys.json", - ); - const backendKeys: unknown = JSON.parse(readFileSync(fixture, "utf8")); +// The monorepo sits next to the frontend; vitest runs from ApiCore-Frontend. +// The frontend image build only sees ApiCore-Frontend, so the comparison runs +// in the monorepo checkout (local gates) and is skipped inside that build. +const fixture = path.resolve( + process.cwd(), + "../ApiCore-Backend/test/fixtures/placeholder-keys.json", +); - expect([...PLACEHOLDER_KEYS]).toEqual(backendKeys); - }); +describe("placeholder keys", () => { + it.skipIf(!existsSync(fixture))( + "the frontend list equals the backend fixture ApiCore-Backend/test/fixtures/placeholder-keys.json", + () => { + const backendKeys: unknown = JSON.parse(readFileSync(fixture, "utf8")); + + expect([...PLACEHOLDER_KEYS]).toEqual(backendKeys); + }, + ); it("has a German label for every key", () => { for (const key of PLACEHOLDER_KEYS) {