test: verify provenance endpoint returns tracing data after generation

master
oabrivard 3 months ago
parent 6fc6fff1f3
commit f7428191ec

@ -268,5 +268,24 @@ test.describe('Live generation with OpenAI', () => {
// Some sites block HEAD requests — skip rather than fail // Some sites block HEAD requests — skip rather than fail
} }
} }
// ═══════════════════════════════════════════════════════════════
// Provenance verification
// ═══════════════════════════════════════════════════════════════
const provResp = await apiCall(page, 'GET', `/api/v1/syntheses/${synthesisId}/provenance`);
expect(provResp.status).toBe(200);
const provenance = provResp.data;
expect(Array.isArray(provenance)).toBe(true);
expect(provenance.length).toBeGreaterThan(0);
// At least some entries should be 'used'
const usedEntries = provenance.filter((e: any) => e.status === 'used');
expect(usedEntries.length).toBeGreaterThan(0);
// Every used entry should have a synthesis_id matching this synthesis
for (const entry of usedEntries) {
expect(entry.synthesis_id).toBe(synthesisId);
expect(entry.job_id).toBeTruthy();
}
}); });
}); });

Loading…
Cancel
Save