fix(cv-qa): preserve ambiguous structures and measure extraction accuracy

This commit is contained in:
cesnimda
2026-10-27 00:26:40 +01:00
parent 5e68848cf7
commit 48b899c8de
13 changed files with 8698 additions and 53 deletions
@@ -52,6 +52,14 @@ beforeEach(() => {
afterEach(() => jest.clearAllMocks());
test('inferred paragraph grouping displays an explicit verification warning without approving it', async () => {
currentReview = { ...review, groups: review.groups.map(group => ({ ...group, fields: group.fields.map(field => ({ ...field, method: 'legacy-paragraph-continuation', reviewState: 'needs_review' })) })) };
renderImport();
expect((await screen.findAllByText('Suggested grouping: verify that this detail belongs to this record before approving it.')).length).toBe(2);
expect(screen.getByRole('button', { name: 'Apply reviewed changes' })).toBeDisabled();
expect(mockedApi.post).not.toHaveBeenCalled();
});
test('a source-mapped missing record can be the only approved change and survives stale review without a stale target', async () => {
currentReview = { ...review, groups: [], sourceBlocks: [{ id: 'b1', text: 'Engineer', kind: 'paragraph', page: 1 }, { id: 'b2', text: 'Example AS', kind: 'paragraph', page: 1 }], mappingCategories: [{ category: 'jobs', fields: [{ name: 'title', multiple: false }, { name: 'company', multiple: false }] }], targets: [{ category: 'jobs', index: 0, label: 'Saved job' }] };
renderImport();