Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-20 12:09:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-20 12:09:16 +0300
commit55e6eebd6fc60bd98d94303983468b3020d2a211 (patch)
treec922d4773a92a2c34c1f134746ada25113e67bb1 /spec/frontend
parent52fac331ea3cc2b2dbc126f4b859350f30167632 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
-rw-r--r--spec/frontend/lib/utils/text_markdown_spec.js19
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';