Merge branch 'develop' into fix/CW-6944

This commit is contained in:
Sivin Varghese
2026-05-05 14:19:18 +05:30
committed by GitHub
16 changed files with 260 additions and 93 deletions
@@ -336,6 +336,38 @@ describe('removeSignature', () => {
'This is a test\n\n'
);
});
it('strips blank-paragraph marker before the delimiter', () => {
expect(removeSignature('hey\n\n\\\n--\n\nHello there', 'Hello there')).toBe(
'hey'
);
});
it('strips multiple consecutive blank-paragraph markers before the delimiter', () => {
expect(
removeSignature('wewe\n\n\\\n\\\n\\\n--\n\nHello there', 'Hello there')
).toBe('wewe');
});
it('strips dangling hardbreak when signature shared a paragraph with "--"', () => {
expect(removeSignature('hey\n\n--\\\nHello there', 'Hello there')).toBe(
'hey\n\n'
);
});
it('preserves trailing backslash in user text when appending', () => {
expect(appendSignature('The path is C:\\', 'Best\nAgent')).toContain(
'C:\\'
);
expect(appendSignature('C:\\\n', 'Best\nAgent')).toContain('C:\\');
expect(appendSignature('C:\\\n\n', 'Best\nAgent')).toContain('C:\\');
});
it('preserves trailing backslash in user text when removing', () => {
expect(removeSignature('C:\\\n--\n\nBest\nAgent', 'Best\nAgent')).toContain(
'C:\\'
);
expect(removeSignature('C:\\\n--', 'no matching sig')).toContain('C:\\');
expect(removeSignature('C:\\\nBest\\\nAgent', 'Best\nAgent')).toContain(
'C:\\'
);
expect(removeSignature('notes\n\\\n--', 'no matching sig')).toContain('\\');
});
});
describe('removeSignature with stripped signature', () => {