Skip to content

Commit

Permalink
Update ExpensiMark-Markdown-Truncate-test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonhenry committed Jul 14, 2024
1 parent f46585b commit 01311ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions __tests__/ExpensiMark-Markdown-Truncate-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <strong>long <em>nested</em> markdown</strong> text. It contains <strong><em>bold italic</em></strong> and <del><em>strikethrough italic</em></del> formatting. The truncation should handle the nesting correctly.',
'This is a <strong>long <em>nested</em> markdown</strong> text. It contains <strong><em>bold italic</em></strong> and <del><em>strikethrough italic</em></del> formatting. The truncation should ...',
);
});

Expand All @@ -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 <code>inline code</code>. The inline code should be preserved in the truncated text.');
expect(result).toBe('This is a text with <code>inlin...</code>');
});

test('should handle HTML with headings', () => {
Expand Down

0 comments on commit 01311ad

Please sign in to comment.