Skip to content

Commit

Permalink
change order of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid committed Nov 14, 2023
1 parent 429a2af commit 8459b1b
Showing 1 changed file with 23 additions and 25 deletions.
48 changes: 23 additions & 25 deletions __tests__/ExpensiMark-HTML-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1493,9 +1493,23 @@ test('Mention', () => {
});

describe('edit mode', () => {
test('normal quote', () => {
const quoteTestStartString = '>This is a *quote* that started on a new line.\nHere is a >quote that did not\n```\nhere is a codefenced quote\n>it should not be quoted\n```';
const quoteTestReplacedString = '<blockquote>This is a <strong>quote</strong> that started on a new line.</blockquote><br />Here is a &gt;quote that did not <pre>here&#32;is&#32;a&#32;codefenced&#32;quote<br />&gt;it&#32;should&#32;not&#32;be&#32;quoted<br /></pre>';
test('quote without space', () => {
const quoteTestStartString = '>Hello world';
const quoteTestReplacedString = '<blockquote>Hello world</blockquote>';

expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString);
});

test('quote with space', () => {
const quoteTestStartString = '> Hello world';
const quoteTestReplacedString = '<blockquote> Hello world</blockquote>';

expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString);
});

test('quote with a lot of spaces', () => {
const quoteTestStartString = '> Hello world';
const quoteTestReplacedString = '<blockquote> Hello world</blockquote>';

expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString);
});
Expand Down Expand Up @@ -1528,27 +1542,6 @@ describe('edit mode', () => {
expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString);
});

test('quote without space', () => {
const quoteTestStartString = '>Hello world';
const quoteTestReplacedString = '<blockquote>Hello world</blockquote>';

expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString);
});

test('quote with space', () => {
const quoteTestStartString = '> Hello world';
const quoteTestReplacedString = '<blockquote> Hello world</blockquote>';

expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString);
});

test('quote with a lot of spaces', () => {
const quoteTestStartString = '> Hello world';
const quoteTestReplacedString = '<blockquote> Hello world</blockquote>';

expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString);
});

describe('trailing whitespace', () => {
test('nothing', () => {
const quoteTestStartString = '>Hello world!';
Expand All @@ -1571,6 +1564,11 @@ describe('edit mode', () => {
expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString);
});
});
});

test('quote with other markdowns', () => {
const quoteTestStartString = '>This is a *quote* that started on a new line.\nHere is a >quote that did not\n```\nhere is a codefenced quote\n>it should not be quoted\n```';
const quoteTestReplacedString = '<blockquote>This is a <strong>quote</strong> that started on a new line.</blockquote><br />Here is a &gt;quote that did not <pre>here&#32;is&#32;a&#32;codefenced&#32;quote<br />&gt;it&#32;should&#32;not&#32;be&#32;quoted<br /></pre>';

expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString);
});
});

0 comments on commit 8459b1b

Please sign in to comment.