-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
23 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1491,22 +1491,22 @@ test('Mention', () => { | |
expect(parser.replace(testString)).toBe('<mention-user>@[email protected]</mention-user>'); | ||
}); | ||
|
||
describe('edit mode', () => { | ||
describe('when should keep whitespace flag is enabled', () => { | ||
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', () => { | ||
test('quote with single 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', () => { | ||
test('quote with multiple spaces', () => { | ||
const quoteTestStartString = '> Hello world'; | ||
const quoteTestReplacedString = '<blockquote> Hello world</blockquote>'; | ||
|
||
|
@@ -1520,35 +1520,37 @@ describe('edit mode', () => { | |
expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); | ||
}); | ||
|
||
test('mixed blocqoutes', () => { | ||
test('separate blockqoutes', () => { | ||
const quoteTestStartString = '>Lorem ipsum\ndolor\n>sit amet'; | ||
const quoteTestReplacedString = '<blockquote>Lorem ipsum</blockquote><br />dolor<br /><blockquote>sit amet</blockquote>'; | ||
|
||
expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); | ||
}); | ||
|
||
test('nested quote and heading', () => { | ||
const quoteTestStartString = '># Hello world'; | ||
const quoteTestReplacedString = '<blockquote><h1>Hello world</h1></blockquote>'; | ||
describe('nested heading in blockquote', () => { | ||
test('without spaces', () => { | ||
const quoteTestStartString = '># Hello world'; | ||
const quoteTestReplacedString = '<blockquote><h1>Hello world</h1></blockquote>'; | ||
|
||
expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); | ||
}); | ||
expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); | ||
}); | ||
|
||
test('nested quote and heading with space between', () => { | ||
const quoteTestStartString = '> # Hello world'; | ||
const quoteTestReplacedString = '<blockquote> <h1>Hello world</h1></blockquote>'; | ||
test('with single space', () => { | ||
const quoteTestStartString = '> # Hello world'; | ||
const quoteTestReplacedString = '<blockquote> <h1>Hello world</h1></blockquote>'; | ||
|
||
expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); | ||
}); | ||
expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); | ||
}); | ||
|
||
test('nested quote and heading with many spaces after #', () => { | ||
const quoteTestStartString = '># Hello world'; | ||
const quoteTestReplacedString = '<blockquote><h1> Hello world</h1></blockquote>'; | ||
test('with multiple spaces after #', () => { | ||
const quoteTestStartString = '># Hello world'; | ||
const quoteTestReplacedString = '<blockquote><h1> Hello world</h1></blockquote>'; | ||
|
||
expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); | ||
expect(parser.replace(quoteTestStartString, {shouldKeepWhitespace: true})).toBe(quoteTestReplacedString); | ||
}); | ||
}); | ||
|
||
describe('trailing whitespace', () => { | ||
describe('trailing whitespace after blockquote', () => { | ||
test('nothing', () => { | ||
const quoteTestStartString = '>Hello world!'; | ||
const quoteTestReplacedString = '<blockquote>Hello world!</blockquote>'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters