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>2022-05-31 12:08:17 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-31 12:08:17 +0300
commitdcbe65b8b6d3be931c10a823d1271318f70b1507 (patch)
treebd4da373dd9dc1d4ad8605960ea02f46198d8356 /spec/frontend/vue_shared/components/source_viewer
parenta9f214d42107c847fcc8fb2a5dff78ba17363e41 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_shared/components/source_viewer')
-rw-r--r--spec/frontend/vue_shared/components/source_viewer/plugins/wrap_comments_spec.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/frontend/vue_shared/components/source_viewer/plugins/wrap_comments_spec.js b/spec/frontend/vue_shared/components/source_viewer/plugins/wrap_comments_spec.js
index 5c0cee7781e..5fd4182da29 100644
--- a/spec/frontend/vue_shared/components/source_viewer/plugins/wrap_comments_spec.js
+++ b/spec/frontend/vue_shared/components/source_viewer/plugins/wrap_comments_spec.js
@@ -15,6 +15,15 @@ describe('Highlight.js plugin for wrapping comments', () => {
const inputValue = '<span class="hljs-keyword">const</span>';
const hljsResultMock = { value: inputValue };
+ wrapComments(hljsResultMock);
+ expect(hljsResultMock.value).toBe(inputValue);
+ });
+
+ it('does not mutate the input value if the hljs comment line includes a closing tag', () => {
+ const inputValue = `<span class="${HLJS_COMMENT_SELECTOR}">/* Line 1 </span> \n* Line 2 \n*/`;
+ const hljsResultMock = { value: inputValue };
+
+ wrapComments(hljsResultMock);
expect(hljsResultMock.value).toBe(inputValue);
});
});