diff options
Diffstat (limited to 'spec/frontend/pipeline_editor/pipeline_editor_app_spec.js')
-rw-r--r-- | spec/frontend/pipeline_editor/pipeline_editor_app_spec.js | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/spec/frontend/pipeline_editor/pipeline_editor_app_spec.js b/spec/frontend/pipeline_editor/pipeline_editor_app_spec.js index 1989f23a415..9fe1536d3f5 100644 --- a/spec/frontend/pipeline_editor/pipeline_editor_app_spec.js +++ b/spec/frontend/pipeline_editor/pipeline_editor_app_spec.js @@ -55,11 +55,12 @@ jest.mock('~/lib/utils/url_utility', () => ({ const localVue = createLocalVue(); localVue.use(VueApollo); -const mockProvide = { +const defaultProvide = { ciConfigPath: mockCiConfigPath, defaultBranch: mockDefaultBranch, newMergeRequestPath: mockNewMergeRequestPath, projectFullPath: mockProjectFullPath, + usesExternalConfig: false, }; describe('Pipeline editor app component', () => { @@ -79,7 +80,7 @@ describe('Pipeline editor app component', () => { stubs = {}, } = {}) => { wrapper = shallowMount(PipelineEditorApp, { - provide: { ...mockProvide, ...provide }, + provide: { ...defaultProvide, ...provide }, stubs, mocks: { $apollo: { @@ -229,6 +230,22 @@ describe('Pipeline editor app component', () => { mockLatestCommitShaQuery.mockResolvedValue(mockCommitShaResults); }); + describe('when project uses an external CI config file', () => { + beforeEach(async () => { + await createComponentWithApollo({ + provide: { + usesExternalConfig: true, + }, + }); + }); + + it('shows an empty state and does not show editor home component', () => { + expect(findEmptyState().exists()).toBe(true); + expect(findAlert().exists()).toBe(false); + expect(findEditorHome().exists()).toBe(false); + }); + }); + describe('when file exists', () => { beforeEach(async () => { await createComponentWithApollo(); |