diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-12 07:35:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-12 07:35:15 +0300 |
commit | d81721fdfb0913b197e5e53d577833cd5bde4a4f (patch) | |
tree | efb21e265bc1c13f66b7ea5c4cf470bc52a48b84 /spec/frontend/vue_shared | |
parent | b5d655aea242b952abb8c020482fe8b810cb4d30 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_shared')
-rw-r--r-- | spec/frontend/vue_shared/components/source_viewer/source_viewer_deprecated_spec.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/frontend/vue_shared/components/source_viewer/source_viewer_deprecated_spec.js b/spec/frontend/vue_shared/components/source_viewer/source_viewer_deprecated_spec.js index 8419a0c5ddf..e46c30d7c49 100644 --- a/spec/frontend/vue_shared/components/source_viewer/source_viewer_deprecated_spec.js +++ b/spec/frontend/vue_shared/components/source_viewer/source_viewer_deprecated_spec.js @@ -12,6 +12,8 @@ import { ROUGE_TO_HLJS_LANGUAGE_MAP, LINES_PER_CHUNK, LEGACY_FALLBACKS, + CODEOWNERS_FILE_NAME, + CODEOWNERS_LANGUAGE, } from '~/vue_shared/components/source_viewer/constants'; import waitForPromises from 'helpers/wait_for_promises'; import LineHighlighter from '~/blob/line_highlighter'; @@ -132,6 +134,18 @@ describe('Source Viewer component', () => { expect(hljs.registerLanguage).toHaveBeenCalledWith('ruby', languageDefinition.default); }); + it('registers codeowners language definition if file name is CODEOWNERS', async () => { + await createComponent({ name: CODEOWNERS_FILE_NAME }); + const languageDefinition = await import( + '~/vue_shared/components/source_viewer/languages/codeowners' + ); + + expect(hljs.registerLanguage).toHaveBeenCalledWith( + CODEOWNERS_LANGUAGE, + languageDefinition.default, + ); + }); + it('highlights the first chunk', () => { expect(hljs.highlight).toHaveBeenCalledWith(chunk1.trim(), { language: mappedLanguage }); expect(findChunks().at(0).props('isFirstChunk')).toBe(true); |