diff options
Diffstat (limited to 'spec/frontend/pipelines/components')
15 files changed, 9 insertions, 88 deletions
diff --git a/spec/frontend/pipelines/components/dag/dag_annotations_spec.js b/spec/frontend/pipelines/components/dag/dag_annotations_spec.js index 28a08b6da0f..aecaa640266 100644 --- a/spec/frontend/pipelines/components/dag/dag_annotations_spec.js +++ b/spec/frontend/pipelines/components/dag/dag_annotations_spec.js @@ -28,11 +28,6 @@ describe('The DAG annotations', () => { }); }; - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - describe('when there is one annotation', () => { const currentNote = singleNote['dag-link103']; diff --git a/spec/frontend/pipelines/components/dag/dag_graph_spec.js b/spec/frontend/pipelines/components/dag/dag_graph_spec.js index 4619548d1bb..6b46be3dd49 100644 --- a/spec/frontend/pipelines/components/dag/dag_graph_spec.js +++ b/spec/frontend/pipelines/components/dag/dag_graph_spec.js @@ -36,11 +36,6 @@ describe('The DAG graph', () => { createComponent({ graphData: parsedData }); }); - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - describe('in the basic case', () => { beforeEach(() => { /* diff --git a/spec/frontend/pipelines/components/dag/dag_spec.js b/spec/frontend/pipelines/components/dag/dag_spec.js index b0c26976c85..e2dc8120309 100644 --- a/spec/frontend/pipelines/components/dag/dag_spec.js +++ b/spec/frontend/pipelines/components/dag/dag_spec.js @@ -51,11 +51,6 @@ describe('Pipeline DAG graph wrapper', () => { }); }; - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - describe('when a query argument is undefined', () => { beforeEach(() => { createComponent({ diff --git a/spec/frontend/pipelines/components/jobs/failed_jobs_app_spec.js b/spec/frontend/pipelines/components/jobs/failed_jobs_app_spec.js index d1da7cb3acf..169e3666cbd 100644 --- a/spec/frontend/pipelines/components/jobs/failed_jobs_app_spec.js +++ b/spec/frontend/pipelines/components/jobs/failed_jobs_app_spec.js @@ -4,7 +4,7 @@ import Vue from 'vue'; import VueApollo from 'vue-apollo'; import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; -import { createAlert } from '~/flash'; +import { createAlert } from '~/alert'; import FailedJobsApp from '~/pipelines/components/jobs/failed_jobs_app.vue'; import FailedJobsTable from '~/pipelines/components/jobs/failed_jobs_table.vue'; import GetFailedJobsQuery from '~/pipelines/graphql/queries/get_failed_jobs.query.graphql'; @@ -12,7 +12,7 @@ import { mockFailedJobsQueryResponse, mockFailedJobsSummaryData } from '../../mo Vue.use(VueApollo); -jest.mock('~/flash'); +jest.mock('~/alert'); describe('Failed Jobs App', () => { let wrapper; @@ -44,10 +44,6 @@ describe('Failed Jobs App', () => { resolverSpy = jest.fn().mockResolvedValue(mockFailedJobsQueryResponse); }); - afterEach(() => { - wrapper.destroy(); - }); - describe('loading spinner', () => { it('displays loading spinner when fetching failed jobs', () => { createComponent(resolverSpy); diff --git a/spec/frontend/pipelines/components/jobs/failed_jobs_table_spec.js b/spec/frontend/pipelines/components/jobs/failed_jobs_table_spec.js index 0df15afd70d..0ac3b6c9074 100644 --- a/spec/frontend/pipelines/components/jobs/failed_jobs_table_spec.js +++ b/spec/frontend/pipelines/components/jobs/failed_jobs_table_spec.js @@ -4,7 +4,7 @@ import VueApollo from 'vue-apollo'; import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; import { mountExtended } from 'helpers/vue_test_utils_helper'; -import { createAlert } from '~/flash'; +import { createAlert } from '~/alert'; import { redirectTo } from '~/lib/utils/url_utility'; import FailedJobsTable from '~/pipelines/components/jobs/failed_jobs_table.vue'; import RetryFailedJobMutation from '~/pipelines/graphql/mutations/retry_failed_job.mutation.graphql'; @@ -15,7 +15,7 @@ import { mockPreparedFailedJobsDataNoPermission, } from '../../mock_data'; -jest.mock('~/flash'); +jest.mock('~/alert'); jest.mock('~/lib/utils/url_utility'); Vue.use(VueApollo); @@ -45,10 +45,6 @@ describe('Failed Jobs Table', () => { }); }; - afterEach(() => { - wrapper.destroy(); - }); - it('displays the failed jobs table', () => { createComponent(); diff --git a/spec/frontend/pipelines/components/jobs/jobs_app_spec.js b/spec/frontend/pipelines/components/jobs/jobs_app_spec.js index 9bc14266593..52df7b4500b 100644 --- a/spec/frontend/pipelines/components/jobs/jobs_app_spec.js +++ b/spec/frontend/pipelines/components/jobs/jobs_app_spec.js @@ -4,7 +4,7 @@ import Vue from 'vue'; import VueApollo from 'vue-apollo'; import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; -import { createAlert } from '~/flash'; +import { createAlert } from '~/alert'; import JobsApp from '~/pipelines/components/jobs/jobs_app.vue'; import JobsTable from '~/jobs/components/table/jobs_table.vue'; import getPipelineJobsQuery from '~/pipelines/graphql/queries/get_pipeline_jobs.query.graphql'; @@ -12,7 +12,7 @@ import { mockPipelineJobsQueryResponse } from '../../mock_data'; Vue.use(VueApollo); -jest.mock('~/flash'); +jest.mock('~/alert'); describe('Jobs app', () => { let wrapper; @@ -45,10 +45,6 @@ describe('Jobs app', () => { resolverSpy = jest.fn().mockResolvedValue(mockPipelineJobsQueryResponse); }); - afterEach(() => { - wrapper.destroy(); - }); - describe('loading spinner', () => { const setup = async () => { createComponent(resolverSpy); diff --git a/spec/frontend/pipelines/components/pipeline_mini_graph/linked_pipelines_mini_list_spec.js b/spec/frontend/pipelines/components/pipeline_mini_graph/linked_pipelines_mini_list_spec.js index 5ea57c51e70..a4ecb9041c9 100644 --- a/spec/frontend/pipelines/components/pipeline_mini_graph/linked_pipelines_mini_list_spec.js +++ b/spec/frontend/pipelines/components/pipeline_mini_graph/linked_pipelines_mini_list_spec.js @@ -19,7 +19,7 @@ describe('Linked pipeline mini list', () => { const createComponent = (props = {}) => { wrapper = mount(LinkedPipelinesMiniList, { directives: { - GlTooltip: createMockDirective(), + GlTooltip: createMockDirective('gl-tooltip'), }, propsData: { ...props, @@ -34,11 +34,6 @@ describe('Linked pipeline mini list', () => { }); }); - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - it('should render one linked pipeline item', () => { expect(findLinkedPipelineMiniItem().exists()).toBe(true); }); @@ -102,11 +97,6 @@ describe('Linked pipeline mini list', () => { }); }); - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - it('should render three linked pipeline items', () => { expect(findLinkedPipelineMiniItems().exists()).toBe(true); expect(findLinkedPipelineMiniItems().length).toBe(3); diff --git a/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_mini_graph_spec.js b/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_mini_graph_spec.js index 036b82530d5..e7415a6c596 100644 --- a/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_mini_graph_spec.js +++ b/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_mini_graph_spec.js @@ -33,11 +33,6 @@ describe('Pipeline Mini Graph', () => { createComponent(); }); - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - it('should render the pipeline stages', () => { expect(findPipelineStages().exists()).toBe(true); }); @@ -71,11 +66,6 @@ describe('Pipeline Mini Graph', () => { }); }); - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - it('should have the correct props', () => { expect(findPipelineMiniGraph().props()).toMatchObject({ downstreamPipelines: [], @@ -118,11 +108,6 @@ describe('Pipeline Mini Graph', () => { }); }); - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - it('should render the downstream linked pipelines mini list only', () => { expect(findLinkedPipelineDownstream().exists()).toBe(true); expect(findLinkedPipelineUpstream().exists()).toBe(false); diff --git a/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stage_spec.js b/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stage_spec.js index ab2056b4035..864f2d66f60 100644 --- a/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stage_spec.js +++ b/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stage_spec.js @@ -45,11 +45,10 @@ describe('Pipelines stage component', () => { }); afterEach(() => { - wrapper.destroy(); - wrapper = null; - eventHub.$emit.mockRestore(); mock.restore(); + // eslint-disable-next-line @gitlab/vtu-no-explicit-wrapper-destroy + wrapper.destroy(); }); const findCiActionBtn = () => wrapper.find('.js-ci-action'); diff --git a/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stages_spec.js b/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stages_spec.js index c123f53886e..73e810bde99 100644 --- a/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stages_spec.js +++ b/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stages_spec.js @@ -60,9 +60,4 @@ describe('Pipeline Stages', () => { expect(findPipelineStagesAt(0).props('isMergeTrain')).toBe(true); expect(findPipelineStagesAt(1).props('isMergeTrain')).toBe(true); }); - - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); }); diff --git a/spec/frontend/pipelines/components/pipeline_tabs_spec.js b/spec/frontend/pipelines/components/pipeline_tabs_spec.js index c2cb95d4320..337af6c1f60 100644 --- a/spec/frontend/pipelines/components/pipeline_tabs_spec.js +++ b/spec/frontend/pipelines/components/pipeline_tabs_spec.js @@ -39,10 +39,6 @@ describe('The Pipeline Tabs', () => { ); }; - afterEach(() => { - wrapper.destroy(); - }); - describe('Tabs', () => { it.each` tabName | tabComponent diff --git a/spec/frontend/pipelines/components/pipelines_filtered_search_spec.js b/spec/frontend/pipelines/components/pipelines_filtered_search_spec.js index ba7262353f0..51a4487a3ef 100644 --- a/spec/frontend/pipelines/components/pipelines_filtered_search_spec.js +++ b/spec/frontend/pipelines/components/pipelines_filtered_search_spec.js @@ -51,8 +51,6 @@ describe('Pipelines filtered search', () => { afterEach(() => { mock.restore(); - wrapper.destroy(); - wrapper = null; }); it('displays UI elements', () => { diff --git a/spec/frontend/pipelines/components/pipelines_list/empty_state/ci_templates_spec.js b/spec/frontend/pipelines/components/pipelines_list/empty_state/ci_templates_spec.js index 6531a15ab8e..b560eea4882 100644 --- a/spec/frontend/pipelines/components/pipelines_list/empty_state/ci_templates_spec.js +++ b/spec/frontend/pipelines/components/pipelines_list/empty_state/ci_templates_spec.js @@ -29,11 +29,6 @@ describe('CI Templates', () => { const findTemplateName = () => wrapper.findByTestId('template-name'); const findTemplateLogo = () => wrapper.findByTestId('template-logo'); - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - describe('renders template list', () => { beforeEach(() => { createWrapper(); diff --git a/spec/frontend/pipelines/components/pipelines_list/empty_state/ios_templates_spec.js b/spec/frontend/pipelines/components/pipelines_list/empty_state/ios_templates_spec.js index 0c2938921d6..700be076e0c 100644 --- a/spec/frontend/pipelines/components/pipelines_list/empty_state/ios_templates_spec.js +++ b/spec/frontend/pipelines/components/pipelines_list/empty_state/ios_templates_spec.js @@ -37,11 +37,6 @@ describe('iOS Templates', () => { const findSetupRunnerLink = () => wrapper.findByText('Set up a runner'); const configurePipelineLink = () => wrapper.findByTestId('configure-pipeline-link'); - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - describe('when ios runners are not available', () => { beforeEach(() => { wrapper = createWrapper({ iosRunnersAvailable: false }); diff --git a/spec/frontend/pipelines/components/pipelines_list/empty_state/pipelines_ci_templates_spec.js b/spec/frontend/pipelines/components/pipelines_list/empty_state/pipelines_ci_templates_spec.js index f255e0d857f..0f4a2b1d02f 100644 --- a/spec/frontend/pipelines/components/pipelines_list/empty_state/pipelines_ci_templates_spec.js +++ b/spec/frontend/pipelines/components/pipelines_list/empty_state/pipelines_ci_templates_spec.js @@ -42,11 +42,6 @@ describe('Pipelines CI Templates', () => { const findDocumentationLink = () => wrapper.findByTestId('documentation-link'); const findSettingsButton = () => wrapper.findByTestId('settings-button'); - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - describe('renders test template', () => { beforeEach(() => { wrapper = createWrapper(); |