fix(cv-qa): preserve ambiguous structures and measure extraction accuracy
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -56,6 +56,7 @@ export const translations = {
|
||||
cvImportMappingRemove: "Remove mapped record",
|
||||
cvImportMappingEvidenceError: "Choose source evidence for every value. Use correction only for values you have checked.",
|
||||
cvImportMappingNotice: "Map missing information from the source. Choose a destination and approve each record. These are your reviewed assignments.",
|
||||
cvImportGroupingCheck: "Suggested grouping: verify that this detail belongs to this record before approving it.",
|
||||
cvImportLinkLabel: "Link label",
|
||||
cvImportQualificationLevel: "Stated qualification level",
|
||||
cvImportFieldRole: "Role",
|
||||
@@ -3055,6 +3056,7 @@ export const translations = {
|
||||
cvImportMappingRemove: "Fjern tilordnet oppføring",
|
||||
cvImportMappingEvidenceError: "Velg kildegrunnlag for hver verdi. Bruk rettelse bare for verdier du har kontrollert.",
|
||||
cvImportMappingNotice: "Tilordne manglende informasjon fra kilden. Velg mål og godkjenn hver oppføring. Dette er dine gjennomgåtte tilordninger.",
|
||||
cvImportGroupingCheck: "Foreslått gruppering: kontroller at denne detaljen tilhører denne oppføringen før du godkjenner den.",
|
||||
cvImportLinkLabel: "Lenkenavn",
|
||||
cvImportQualificationLevel: "Oppgitt kvalifikasjonsnivå",
|
||||
cvImportFieldRole: "Rolle",
|
||||
|
||||
@@ -197,7 +197,7 @@ export default function CvImportReview({ runId, disabled, onApplyingChange, onAp
|
||||
<Typography variant="caption" color="text.secondary">{t("cvImportEvidence")}{field.sourcePage ? ` · ${t("cvImportPage", { page: field.sourcePage })}` : ""}</Typography>
|
||||
{field.sourcePage ? <Typography variant="caption" sx={{ display: "block" }}>{t("cvImportPage", { page: field.sourcePage })}</Typography> : null}
|
||||
<Typography variant="body2" sx={{ whiteSpace: "pre-wrap" }}>{field.sourceSnippet || t("cvImportNoEvidence")}</Typography>
|
||||
<Typography variant="caption" color="text.secondary">{t(field.method === "docling" ? "cvImportMethodDocument" : "cvImportMethodDeterministic")}</Typography>
|
||||
{field.reviewState === "needs_review" ? <Alert severity="warning" sx={{ mt: 1 }}>{t("cvImportGroupingCheck")}</Alert> : <Typography variant="caption" color="text.secondary">{t(field.method === "docling" ? "cvImportMethodDocument" : "cvImportMethodDeterministic")}</Typography>}
|
||||
</Box>
|
||||
<FormControl variant="standard" fullWidth sx={{ mt: 1 }}>
|
||||
<InputLabel htmlFor={inputId} shrink>{t("cvImportDecision", { field: fieldLabel })}</InputLabel>
|
||||
|
||||
Reference in New Issue
Block a user