mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
test(qa): align AI oracles with fixtures and honor QA_OUT_DIR (#686)
The ocr oracle demanded six pangram words when ocr-clean.png prints five; the ocr-pdf oracle expected a searchable PDF when the tool's contract is text extraction; media-30s.mp4 was eight seconds long. Fix all three, regenerate tool-contract.json from current schemas, record the new fixture in the manifest, and add a QA_OUT_DIR override so parallel machines stop clobbering each other's lane output. Fixes #677.
This commit is contained in:
@@ -570,17 +570,6 @@ export function expectJapaneseScript(text: string, minimumChars = 4): void {
|
||||
);
|
||||
}
|
||||
|
||||
/** PDF OCR: a real PDF that now carries a selectable text layer. */
|
||||
export function expectSearchablePdf(output: Buffer): void {
|
||||
assertOracle(output.subarray(0, 5).toString("latin1") === "%PDF-", "artifact is not a PDF");
|
||||
assertOracle(output.length > 1000, "PDF artifact is implausibly small");
|
||||
const body = output.toString("latin1");
|
||||
assertOracle(
|
||||
body.includes("/Font") || body.includes("BT\n") || body.includes("Tj"),
|
||||
"PDF carries no text-drawing operators, so no OCR layer was added",
|
||||
);
|
||||
}
|
||||
|
||||
/** Animated cut-outs must stay animated: a single-frame result is a regression. */
|
||||
export async function expectAnimatedFrames(output: Buffer, minimumFrames = 2): Promise<void> {
|
||||
const meta = await sharp(output, { pages: -1 }).metadata();
|
||||
|
||||
Reference in New Issue
Block a user