fix: keep project entity selection and ignore placeholder hits
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { expect, it } from "bun:test";
|
||||
import {
|
||||
canonicalPerson, filenameScanText, groupReviewHits, makeTextBatches, mappingForSelection, mergePeople,
|
||||
spansBySegment, withoutWhitelistedHits, withoutWhitelistedRules,
|
||||
spansBySegment, withoutPlaceholderHits, withoutWhitelistedHits, withoutWhitelistedRules,
|
||||
} from "../src/lib/project-review";
|
||||
|
||||
it("liest Unterstriche in Namen als Leerzeichen und bewahrt bekannte Codebegriffe", () => {
|
||||
@@ -58,6 +58,17 @@ it("unterdrückt projektweit nur exakt abgewählte Begriffe samt erzwungener Reg
|
||||
], whitelist)).toEqual([{ type: "ORG", value: "Max Muster" }]);
|
||||
});
|
||||
|
||||
it("zeigt beim erneuten Lauf keine Treffer, die einen bestehenden Platzhalter einschließen", () => {
|
||||
const hits = [
|
||||
{ type: "PERSON", original: "PERSON_39, Roman" },
|
||||
{ type: "KUNDE", original: "KUNDE_100005" },
|
||||
{ type: "PERSON", original: "Roman" },
|
||||
{ type: "PERSON", original: "Anlage44" },
|
||||
{ type: "PASSWORT", original: "ORT_08!" },
|
||||
];
|
||||
expect(withoutPlaceholderHits(hits)).toEqual(hits.slice(2));
|
||||
});
|
||||
|
||||
it("fasst ausgewählte Personen zu einem kanonischen Platzhalter zusammen und bewahrt alte Zuordnungen", () => {
|
||||
let merges = mergePeople({}, "PERSON_02", "PERSON_01");
|
||||
merges = mergePeople(merges, "PERSON_03", "PERSON_02");
|
||||
|
||||
Reference in New Issue
Block a user