diff --git a/__tests__/ExpensiMark-HTML-test.js b/__tests__/ExpensiMark-HTML-test.js index 51249c37..2d7be7ca 100644 --- a/__tests__/ExpensiMark-HTML-test.js +++ b/__tests__/ExpensiMark-HTML-test.js @@ -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 = '
This is a quote that started on a new line.
here is a codefenced quote'; + test('quote without space', () => { + const quoteTestStartString = '>Hello world'; + const quoteTestReplacedString = '
>it should not be quoted
Hello world'; + + expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); + }); + + test('quote with space', () => { + const quoteTestStartString = '> Hello world'; + const quoteTestReplacedString = '
Hello world'; + + expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); + }); + + test('quote with a lot of spaces', () => { + const quoteTestStartString = '> Hello world'; + const quoteTestReplacedString = '
Hello world'; expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); }); @@ -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 = '
Hello world'; - - expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); - }); - - test('quote with space', () => { - const quoteTestStartString = '> Hello world'; - const quoteTestReplacedString = '
Hello world'; - - expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); - }); - - test('quote with a lot of spaces', () => { - const quoteTestStartString = '> Hello world'; - const quoteTestReplacedString = '
Hello world'; - - expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); - }); - describe('trailing whitespace', () => { test('nothing', () => { const quoteTestStartString = '>Hello world!'; @@ -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 = '
This is a quote that started on a new line.
here is a codefenced quote'; + expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); + }); +});
>it should not be quoted