chore(web): continuous handoff WBV2-P1154-001
This commit is contained in:
@@ -4,8 +4,9 @@ import path from "node:path";
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
const root = path.resolve(import.meta.dirname, "../../..");
|
||||
const fixtures = JSON.parse(process.env.WBV2_BATCH_FIXTURES ?? "[]") as string[];
|
||||
const fixtures = JSON.parse(process.env.WBV2_BATCH_FIXTURES ?? JSON.stringify(process.env.WBV2_BATCH_FIXTURE ? [process.env.WBV2_BATCH_FIXTURE] : [])) as string[];
|
||||
const task = process.env.WBV2_BATCH_TASK ?? "WBV2-P1152-001";
|
||||
const productionPath = process.env.WBV2_BATCH_PRODUCTION ?? `tests/golden/${task}/modifier-reader-batch-production.json`;
|
||||
const expectedTypes = JSON.parse(process.env.WBV2_BATCH_TYPES ?? "[]") as string[];
|
||||
const sourceUnits = JSON.parse(process.env.WBV2_BATCH_UNITS ?? "[]") as string[];
|
||||
if (!fixtures.length || !expectedTypes.length || !sourceUnits.length) throw new Error("multi-fixture batch requires fixtures, expected types and source units");
|
||||
@@ -78,7 +79,8 @@ test("multi-fixture modifier reader batch preserves Blender Main metadata", asyn
|
||||
...result,
|
||||
};
|
||||
fs.mkdirSync(path.join(root, `tests/golden/${task}`), { recursive: true });
|
||||
fs.writeFileSync(path.join(root, `tests/golden/${task}/modifier-reader-batch-production.json`), `${JSON.stringify(report, null, 2)}\n`);
|
||||
fs.mkdirSync(path.dirname(path.join(root, productionPath)), { recursive: true });
|
||||
fs.writeFileSync(path.join(root, productionPath), `${JSON.stringify(report, null, 2)}\n`);
|
||||
|
||||
const observedTypes = new Set(Object.values(result).flatMap((entry: any) => entry?.types ?? []));
|
||||
for (const type of expectedTypes) expect(observedTypes.has(type)).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user