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:
Diffstat (limited to 'spec/frontend/pipeline_editor/components/pipeline_editor_tabs_spec.js')
-rw-r--r--spec/frontend/pipeline_editor/components/pipeline_editor_tabs_spec.js107
1 files changed, 36 insertions, 71 deletions
diff --git a/spec/frontend/pipeline_editor/components/pipeline_editor_tabs_spec.js b/spec/frontend/pipeline_editor/components/pipeline_editor_tabs_spec.js
index eba853180cd..5cf8d47bc23 100644
--- a/spec/frontend/pipeline_editor/components/pipeline_editor_tabs_spec.js
+++ b/spec/frontend/pipeline_editor/components/pipeline_editor_tabs_spec.js
@@ -20,12 +20,6 @@ describe('Pipeline editor tabs component', () => {
const MockTextEditor = {
template: '<div />',
};
- const mockProvide = {
- glFeatures: {
- ciConfigVisualizationTab: true,
- ciConfigMergedTab: true,
- },
- };
const createComponent = ({
props = {},
@@ -44,7 +38,7 @@ describe('Pipeline editor tabs component', () => {
appStatus,
};
},
- provide: { ...mockProvide, ...provide },
+ provide: { ...provide },
stubs: {
TextEditor: MockTextEditor,
EditorTab,
@@ -82,41 +76,24 @@ describe('Pipeline editor tabs component', () => {
});
describe('visualization tab', () => {
- describe('with feature flag on', () => {
- describe('while loading', () => {
- beforeEach(() => {
- createComponent({ appStatus: EDITOR_APP_STATUS_LOADING });
- });
-
- it('displays a loading icon if the lint query is loading', () => {
- expect(findLoadingIcon().exists()).toBe(true);
- expect(findPipelineGraph().exists()).toBe(false);
- });
- });
- describe('after loading', () => {
- beforeEach(() => {
- createComponent();
- });
-
- it('display the tab and visualization', () => {
- expect(findVisualizationTab().exists()).toBe(true);
- expect(findPipelineGraph().exists()).toBe(true);
- });
+ describe('while loading', () => {
+ beforeEach(() => {
+ createComponent({ appStatus: EDITOR_APP_STATUS_LOADING });
});
- });
- describe('with feature flag off', () => {
+ it('displays a loading icon if the lint query is loading', () => {
+ expect(findLoadingIcon().exists()).toBe(true);
+ expect(findPipelineGraph().exists()).toBe(false);
+ });
+ });
+ describe('after loading', () => {
beforeEach(() => {
- createComponent({
- provide: {
- glFeatures: { ciConfigVisualizationTab: false },
- },
- });
+ createComponent();
});
- it('does not display the tab or component', () => {
- expect(findVisualizationTab().exists()).toBe(false);
- expect(findPipelineGraph().exists()).toBe(false);
+ it('display the tab and visualization', () => {
+ expect(findVisualizationTab().exists()).toBe(true);
+ expect(findPipelineGraph().exists()).toBe(true);
});
});
});
@@ -148,51 +125,39 @@ describe('Pipeline editor tabs component', () => {
});
describe('merged tab', () => {
- describe('with feature flag on', () => {
- describe('while loading', () => {
- beforeEach(() => {
- createComponent({ appStatus: EDITOR_APP_STATUS_LOADING });
- });
-
- it('displays a loading icon if the lint query is loading', () => {
- expect(findLoadingIcon().exists()).toBe(true);
- });
+ describe('while loading', () => {
+ beforeEach(() => {
+ createComponent({ appStatus: EDITOR_APP_STATUS_LOADING });
});
- describe('when there is a fetch error', () => {
- beforeEach(() => {
- createComponent({ appStatus: EDITOR_APP_STATUS_ERROR });
- });
-
- it('show an error message', () => {
- expect(findAlert().exists()).toBe(true);
- expect(findAlert().text()).toBe(wrapper.vm.$options.errorTexts.loadMergedYaml);
- });
+ it('displays a loading icon if the lint query is loading', () => {
+ expect(findLoadingIcon().exists()).toBe(true);
+ });
+ });
- it('does not render the `meged_preview` component', () => {
- expect(findMergedPreview().exists()).toBe(false);
- });
+ describe('when there is a fetch error', () => {
+ beforeEach(() => {
+ createComponent({ appStatus: EDITOR_APP_STATUS_ERROR });
});
- describe('after loading', () => {
- beforeEach(() => {
- createComponent();
- });
+ it('show an error message', () => {
+ expect(findAlert().exists()).toBe(true);
+ expect(findAlert().text()).toBe(wrapper.vm.$options.errorTexts.loadMergedYaml);
+ });
- it('display the tab and the merged preview component', () => {
- expect(findMergedTab().exists()).toBe(true);
- expect(findMergedPreview().exists()).toBe(true);
- });
+ it('does not render the `merged_preview` component', () => {
+ expect(findMergedPreview().exists()).toBe(false);
});
});
- describe('with feature flag off', () => {
+
+ describe('after loading', () => {
beforeEach(() => {
- createComponent({ provide: { glFeatures: { ciConfigMergedTab: false } } });
+ createComponent();
});
- it('does not display the merged tab', () => {
- expect(findMergedTab().exists()).toBe(false);
- expect(findMergedPreview().exists()).toBe(false);
+ it('display the tab and the merged preview component', () => {
+ expect(findMergedTab().exists()).toBe(true);
+ expect(findMergedPreview().exists()).toBe(true);
});
});
});