Test all code snippet sources

parent c3555111
...@@ -6,6 +6,7 @@ import { TEST_HOST } from 'helpers/test_constants'; ...@@ -6,6 +6,7 @@ import { TEST_HOST } from 'helpers/test_constants';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import httpStatusCodes from '~/lib/utils/http_status'; import httpStatusCodes from '~/lib/utils/http_status';
import CodeSnippetAlert from '~/pipeline_editor/components/code_snippet_alert/code_snippet_alert.vue'; import CodeSnippetAlert from '~/pipeline_editor/components/code_snippet_alert/code_snippet_alert.vue';
import { CODE_SNIPPET_SOURCES } from '~/pipeline_editor/components/code_snippet_alert/constants';
import CommitForm from '~/pipeline_editor/components/commit/commit_form.vue'; import CommitForm from '~/pipeline_editor/components/commit/commit_form.vue';
import TextEditor from '~/pipeline_editor/components/editor/text_editor.vue'; import TextEditor from '~/pipeline_editor/components/editor/text_editor.vue';
...@@ -143,9 +144,9 @@ describe('Pipeline editor app component', () => { ...@@ -143,9 +144,9 @@ describe('Pipeline editor app component', () => {
expect(findCodeSnippetAlert().exists()).toBe(false); expect(findCodeSnippetAlert().exists()).toBe(false);
}); });
it('shows if URL param is set and supported, and cleans up URL', () => { it.each(CODE_SNIPPET_SOURCES)('shows if URL param is %s, and cleans up URL', (source) => {
jest.spyOn(window.history, 'replaceState'); jest.spyOn(window.history, 'replaceState');
setCodeSnippetUrlParam('api_fuzzing'); setCodeSnippetUrlParam(source);
createComponent(); createComponent();
expect(findCodeSnippetAlert().exists()).toBe(true); expect(findCodeSnippetAlert().exists()).toBe(true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment