From 01311adc723f79469b10450f536715c2a8bd7514 Mon Sep 17 00:00:00 2001 From: Brandon Henry Date: Sun, 14 Jul 2024 18:58:20 -0500 Subject: [PATCH] Update ExpensiMark-Markdown-Truncate-test.js --- __tests__/ExpensiMark-Markdown-Truncate-test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/ExpensiMark-Markdown-Truncate-test.js b/__tests__/ExpensiMark-Markdown-Truncate-test.js index e2892a11..37bbda4c 100644 --- a/__tests__/ExpensiMark-Markdown-Truncate-test.js +++ b/__tests__/ExpensiMark-Markdown-Truncate-test.js @@ -33,11 +33,11 @@ describe('truncateHTML', () => { test('should handle HTML with nested markdown elements', () => { const markdown = 'This is a *long _nested_ markdown* text. It contains *_bold italic_* and ~_strikethrough italic_~ formatting. The truncation should handle the nesting correctly.'; - const limit = 150; + const limit = 120; const html = parser.replace(markdown); const result = parser.truncateHTML(html, limit, {ellipsis: true}); expect(result).toBe( - 'This is a long nested markdown text. It contains bold italic and strikethrough italic formatting. The truncation should handle the nesting correctly.', + 'This is a long nested markdown text. It contains bold italic and strikethrough italic formatting. The truncation should ...', ); }); @@ -54,10 +54,10 @@ describe('truncateHTML', () => { test('should handle HTML with inline code', () => { const markdown = 'This is a text with `inline code`. The inline code should be preserved in the truncated text.'; - const limit = 150; + const limit = 25; const html = parser.replace(markdown); const result = parser.truncateHTML(html, limit, {ellipsis: true}); - expect(result).toBe('This is a text with inline code. The inline code should be preserved in the truncated text.'); + expect(result).toBe('This is a text with inlin...'); }); test('should handle HTML with headings', () => {