From 7d8d5a3dab415672a41ab29c3bfa9581f275dc50 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 25 Jan 2022 15:12:32 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../frontend/commit/commit_pipeline_status_component_spec.js | 12 ++++++------ spec/frontend/commit/pipelines/pipelines_table_spec.js | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'spec/frontend/commit') diff --git a/spec/frontend/commit/commit_pipeline_status_component_spec.js b/spec/frontend/commit/commit_pipeline_status_component_spec.js index 3a549e66eb7..43db6db00c1 100644 --- a/spec/frontend/commit/commit_pipeline_status_component_spec.js +++ b/spec/frontend/commit/commit_pipeline_status_component_spec.js @@ -1,6 +1,7 @@ import { GlLoadingIcon } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import Visibility from 'visibilityjs'; +import { nextTick } from 'vue'; import fixture from 'test_fixtures/pipelines/pipelines.json'; import createFlash from '~/flash'; import Poll from '~/lib/utils/poll'; @@ -112,7 +113,7 @@ describe('Commit pipeline status component', () => { createComponent(); }); - it('shows the loading icon at start', () => { + it('shows the loading icon at start', async () => { createComponent(); expect(findLoader().exists()).toBe(true); @@ -120,17 +121,16 @@ describe('Commit pipeline status component', () => { data: { pipelines: [] }, }); - return wrapper.vm.$nextTick().then(() => { - expect(findLoader().exists()).toBe(false); - }); + await nextTick(); + expect(findLoader().exists()).toBe(false); }); describe('is successful', () => { - beforeEach(() => { + beforeEach(async () => { pollConfig.successCallback({ data: { pipelines: [{ details: { status: mockCiStatus } }] }, }); - return wrapper.vm.$nextTick(); + await nextTick(); }); it('does not render loader', () => { diff --git a/spec/frontend/commit/pipelines/pipelines_table_spec.js b/spec/frontend/commit/pipelines/pipelines_table_spec.js index e209f628aa2..ac432593d2f 100644 --- a/spec/frontend/commit/pipelines/pipelines_table_spec.js +++ b/spec/frontend/commit/pipelines/pipelines_table_spec.js @@ -1,6 +1,7 @@ import { GlEmptyState, GlLoadingIcon, GlModal, GlTableLite } from '@gitlab/ui'; import { mount } from '@vue/test-utils'; import MockAdapter from 'axios-mock-adapter'; +import { nextTick } from 'vue'; import fixture from 'test_fixtures/pipelines/pipelines.json'; import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import waitForPromises from 'helpers/wait_for_promises'; @@ -238,7 +239,7 @@ describe('Pipelines table in Commits and Merge requests', () => { it('on desktop, shows a security warning modal', async () => { await findRunPipelineBtn().trigger('click'); - await wrapper.vm.$nextTick(); + await nextTick(); expect(findModal()).not.toBeNull(); }); -- cgit v1.2.3