diff --git a/client/src/app/core/ui-services/diff.service.spec.ts b/client/src/app/core/ui-services/diff.service.spec.ts index 4fdcc2db5..38c373aee 100644 --- a/client/src/app/core/ui-services/diff.service.spec.ts +++ b/client/src/app/core/ui-services/diff.service.spec.ts @@ -809,6 +809,24 @@ describe('DiffService', () => { ); })); + it('does not like splitting paragraphs too much, but respects line breaks between paragraphs', inject( + [DiffService], + (service: DiffService) => { + const before = + '
Bavaria ipsum dolor sit amet o’ha wea nia ausgähd, kummt nia hoam i hob di narrisch gean helfgod ebba ded baddscher. Des so so, nia Biawambn back mas? Kaiwe Hetschapfah Trachtnhuat, a bravs.
', + after = + 'Bavaria ipsum dolor sit amet o’ha wea nia ausgähd, kummt nia hoam i hob di narrisch gean helfgod ebba ded baddscher.
\nDes so so, nia Biawambn back mas? Kaiwe Hetschapfah Trachtnhuat, a bravs.'; + const diff = service.diff(before, after); + + expect(diff).toBe( + '
Bavaria ipsum dolor sit amet o’ha wea nia ausgähd, kummt nia hoam i hob di narrisch gean helfgod ebba ded baddscher. Des so so, nia Biawambn back mas? Kaiwe Hetschapfah Trachtnhuat, a bravs.
' + + 'Bavaria ipsum dolor sit amet o’ha wea nia ausgähd, kummt nia hoam i hob di narrisch gean helfgod ebba ded baddscher.
' + + '\n' + + 'Des so so, nia Biawambn back mas? Kaiwe Hetschapfah Trachtnhuat, a bravs.
' + ); + } + )); + it('does not repeat the last word (1)', inject([DiffService], (service: DiffService) => { const before = 'sem. Nulla consequat massa quis enim.
', after = 'sem. Nulla consequat massa quis enim. TEST
\nTEST