From 8a25a8472a550e983d31ef940e49766d6a43571b Mon Sep 17 00:00:00 2001 From: Andre Tarnowsky Date: Thu, 14 Dec 2023 09:06:47 +0100 Subject: [PATCH] add test for overweite mode with non existing target node --- __tests__/merge.test.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/__tests__/merge.test.ts b/__tests__/merge.test.ts index a57e2af..7709b35 100644 --- a/__tests__/merge.test.ts +++ b/__tests__/merge.test.ts @@ -2089,6 +2089,35 @@ describe('merge', () => { expect(norm(result)).toEqual(norm(sourceFileContent)); }); + + it('should update translation without target', () => { + const sourceFileContent = ` + + + + + see more... + mehr anzeigen... + + + + `; + + const destFileContent = ` + + + + + see more... + + + + `; + + const result = merge(sourceFileContent, destFileContent, {overwriteTargetWithTranslated: true}); + + expect(norm(result)).toEqual(norm(sourceFileContent)); + }); }); function norm(xml: string): string {