feat: optionally sort translation mappings by creation date

This commit is contained in:
muena
2026-10-19 06:49:34 +02:00
parent 03a793ad7c
commit a627d9147e
8 changed files with 218 additions and 62 deletions

View File

@@ -118,6 +118,22 @@ it("entfernt eine False-Positive-Gruppe aus der Sitzung und merkt alle Varianten
]);
});
it("bewahrt das Anlagedatum einer Sitzung beim Umklammern und Zusammenfassen", async () => {
const session = await sessions.createSession("Zeitfolge");
const first = await sessions.updateSessionMapping(session.id, {
PERSON_01: { type: "PERSON", original: "Beispiel Eins" },
});
const created = first.mappingCreatedAt?.PERSON_01;
expect(created).toBeTruthy();
const next = await sessions.updateSessionMapping(session.id, {
"<PERSON_01>": { type: "PERSON", original: "Beispiel Eins" },
"<PERSON_02>": { type: "PERSON", original: "Beispiel Zwei", merged_into: "<PERSON_01>" },
});
expect(next.mappingCreatedAt?.["<PERSON_01>"]).toBe(created);
expect(next.mappingCreatedAt?.["<PERSON_02>"]).toBeTruthy();
expect(next.mappingCreatedAt?.PERSON_01).toBeUndefined();
});
it("verlangt eine ausdrückliche Kontextwahl und legt ein Textprojekt nur einmal an", async () => {
const root = await fs.mkdtemp(join(tmpdir(), "velum-text-context-"));
roots.push(root);