diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-09 21:09:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-09 21:09:11 +0300 |
commit | d23f33082ad893fad172b17f1ce66bd847671d56 (patch) | |
tree | bdffb3f1a3f4855d2a9a7f8762f2812366c75a41 /spec/frontend/vue_shared | |
parent | 3670ddd229b178c0a2e09a1466ddfd7fd2f7855d (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 | 19 |
1 files changed, 11 insertions, 8 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 4cec129b6e4..8419a0c5ddf 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 @@ -11,6 +11,7 @@ import { EVENT_LABEL_FALLBACK, ROUGE_TO_HLJS_LANGUAGE_MAP, LINES_PER_CHUNK, + LEGACY_FALLBACKS, } from '~/vue_shared/components/source_viewer/constants'; import waitForPromises from 'helpers/wait_for_promises'; import LineHighlighter from '~/blob/line_highlighter'; @@ -89,14 +90,16 @@ describe('Source Viewer component', () => { }); describe('legacy fallbacks', () => { - it('tracks a fallback event and emits an error when viewing python files', () => { - const fallbackLanguage = 'python'; - const eventData = { label: EVENT_LABEL_FALLBACK, property: fallbackLanguage }; - createComponent({ language: fallbackLanguage }); - - expect(Tracking.event).toHaveBeenCalledWith(undefined, EVENT_ACTION, eventData); - expect(wrapper.emitted('error')).toHaveLength(1); - }); + it.each(LEGACY_FALLBACKS)( + 'tracks a fallback event and emits an error when viewing %s files', + (fallbackLanguage) => { + const eventData = { label: EVENT_LABEL_FALLBACK, property: fallbackLanguage }; + createComponent({ language: fallbackLanguage }); + + expect(Tracking.event).toHaveBeenCalledWith(undefined, EVENT_ACTION, eventData); + expect(wrapper.emitted('error')).toHaveLength(1); + }, + ); }); describe('highlight.js', () => { |