diff options
Diffstat (limited to 'spec/frontend/lib/utils/text_markdown_spec.js')
-rw-r--r-- | spec/frontend/lib/utils/text_markdown_spec.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/frontend/lib/utils/text_markdown_spec.js b/spec/frontend/lib/utils/text_markdown_spec.js index beedb9b2eba..9fe2780fde2 100644 --- a/spec/frontend/lib/utils/text_markdown_spec.js +++ b/spec/frontend/lib/utils/text_markdown_spec.js @@ -70,6 +70,25 @@ describe('init markdown', () => { expect(textArea.value).toContain('# Does not parse the `$` currently.'); }); + it('inserts a new line correctly', () => { + const initialValue = ''; + + textArea.value = initialValue; + textArea.selectionStart = 0; + textArea.selectionEnd = 0; + + insertMarkdownText({ + textArea, + text: textArea.value, + tag: '```suggestion:-0+0\n{text}\n```', + blockTag: true, + selected: '# Does not parse the \\n currently.', + wrap: false, + }); + + expect(textArea.value).toContain('# Does not parse the \\n currently.'); + }); + it('inserts the tag on a new line if the current one is not empty', () => { const initialValue = 'some text'; |