diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-25 18:12:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-25 18:12:32 +0300 |
commit | 7d8d5a3dab415672a41ab29c3bfa9581f275dc50 (patch) | |
tree | 7b9249d8ca8c12ad899b4e6d968193d58e63f458 /spec/frontend/clusters_list | |
parent | 868c8c35fbddd439f4df76a5954e2a1caa2af3cc (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/clusters_list')
5 files changed, 27 insertions, 17 deletions
diff --git a/spec/frontend/clusters_list/components/agent_options_spec.js b/spec/frontend/clusters_list/components/agent_options_spec.js index f20a7b39a97..1d973ab39cc 100644 --- a/spec/frontend/clusters_list/components/agent_options_spec.js +++ b/spec/frontend/clusters_list/components/agent_options_spec.js @@ -1,5 +1,5 @@ import { GlDropdown, GlDropdownItem, GlModal, GlFormInput } from '@gitlab/ui'; -import Vue from 'vue'; +import Vue, { nextTick } from 'vue'; import VueApollo from 'vue-apollo'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { ENTER_KEY } from '~/lib/utils/keys'; @@ -54,7 +54,7 @@ describe('AgentOptions', () => { }); }; - const createWrapper = ({ mutationResponse = mockDeleteResponse } = {}) => { + const createWrapper = async ({ mutationResponse = mockDeleteResponse } = {}) => { apolloProvider = createMockApolloProvider({ mutationResponse }); const provide = { projectPath, @@ -77,7 +77,7 @@ describe('AgentOptions', () => { wrapper.vm.$refs.modal.hide = jest.fn(); writeQuery(); - return wrapper.vm.$nextTick(); + await nextTick(); }; const submitAgentToDelete = async () => { diff --git a/spec/frontend/clusters_list/components/agents_spec.js b/spec/frontend/clusters_list/components/agents_spec.js index c9ca10f6bf7..5d7a6a251d2 100644 --- a/spec/frontend/clusters_list/components/agents_spec.js +++ b/spec/frontend/clusters_list/components/agents_spec.js @@ -1,6 +1,7 @@ import { GlAlert, GlKeysetPagination, GlLoadingIcon } from '@gitlab/ui'; import { createLocalVue, shallowMount } from '@vue/test-utils'; import VueApollo from 'vue-apollo'; +import { nextTick } from 'vue'; import AgentEmptyState from '~/clusters_list/components/agent_empty_state.vue'; import AgentTable from '~/clusters_list/components/agent_table.vue'; import Agents from '~/clusters_list/components/agents.vue'; @@ -21,7 +22,13 @@ describe('Agents', () => { projectPath: 'path/to/project', }; - const createWrapper = ({ props = {}, agents = [], pageInfo = null, trees = [], count = 0 }) => { + const createWrapper = async ({ + props = {}, + agents = [], + pageInfo = null, + trees = [], + count = 0, + }) => { const provide = provideData; const apolloQueryResponse = { data: { @@ -47,7 +54,7 @@ describe('Agents', () => { provide: provideData, }); - return wrapper.vm.$nextTick(); + await nextTick(); }; const findAgentTable = () => wrapper.find(AgentTable); @@ -239,14 +246,14 @@ describe('Agents', () => { }, }; - beforeEach(() => { + beforeEach(async () => { wrapper = shallowMount(Agents, { mocks, propsData: defaultProps, provide: provideData, }); - return wrapper.vm.$nextTick(); + await nextTick(); }); it('displays a loading icon', () => { diff --git a/spec/frontend/clusters_list/components/ancestor_notice_spec.js b/spec/frontend/clusters_list/components/ancestor_notice_spec.js index c7ee2a00f5b..a9f11e6fdf8 100644 --- a/spec/frontend/clusters_list/components/ancestor_notice_spec.js +++ b/spec/frontend/clusters_list/components/ancestor_notice_spec.js @@ -1,5 +1,6 @@ import { GlLink, GlSprintf, GlAlert } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; +import { nextTick } from 'vue'; import AncestorNotice from '~/clusters_list/components/ancestor_notice.vue'; import ClusterStore from '~/clusters_list/store'; @@ -7,10 +8,10 @@ describe('ClustersAncestorNotice', () => { let store; let wrapper; - const createWrapper = () => { + const createWrapper = async () => { store = ClusterStore({ ancestorHelperPath: '/some/ancestor/path' }); wrapper = shallowMount(AncestorNotice, { store, stubs: { GlSprintf, GlAlert } }); - return wrapper.vm.$nextTick(); + await nextTick(); }; beforeEach(() => { @@ -22,9 +23,9 @@ describe('ClustersAncestorNotice', () => { }); describe('when cluster does not have ancestors', () => { - beforeEach(() => { + beforeEach(async () => { store.state.hasAncestorClusters = false; - return wrapper.vm.$nextTick(); + await nextTick(); }); it('displays no notice', () => { @@ -33,9 +34,9 @@ describe('ClustersAncestorNotice', () => { }); describe('when cluster has ancestors', () => { - beforeEach(() => { + beforeEach(async () => { store.state.hasAncestorClusters = true; - return wrapper.vm.$nextTick(); + await nextTick(); }); it('displays notice text', () => { diff --git a/spec/frontend/clusters_list/components/clusters_spec.js b/spec/frontend/clusters_list/components/clusters_spec.js index 9af25a534d8..82e667093aa 100644 --- a/spec/frontend/clusters_list/components/clusters_spec.js +++ b/spec/frontend/clusters_list/components/clusters_spec.js @@ -7,6 +7,7 @@ import { import * as Sentry from '@sentry/browser'; import { mount } from '@vue/test-utils'; import MockAdapter from 'axios-mock-adapter'; +import { nextTick } from 'vue'; import Clusters from '~/clusters_list/components/clusters.vue'; import ClustersEmptyState from '~/clusters_list/components/clusters_empty_state.vue'; import ClusterStore from '~/clusters_list/store'; @@ -176,9 +177,9 @@ describe('Clusters', () => { }); describe('nodes finish loading', () => { - beforeEach(() => { + beforeEach(async () => { wrapper.vm.$store.state.loadingNodes = false; - return wrapper.vm.$nextTick(); + await nextTick(); }); it.each` diff --git a/spec/frontend/clusters_list/components/node_error_help_text_spec.js b/spec/frontend/clusters_list/components/node_error_help_text_spec.js index 18d27f3fd80..8187ab75c58 100644 --- a/spec/frontend/clusters_list/components/node_error_help_text_spec.js +++ b/spec/frontend/clusters_list/components/node_error_help_text_spec.js @@ -1,13 +1,14 @@ import { GlPopover } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; +import { nextTick } from 'vue'; import NodeErrorHelpText from '~/clusters_list/components/node_error_help_text.vue'; describe('NodeErrorHelpText', () => { let wrapper; - const createWrapper = (propsData) => { + const createWrapper = async (propsData) => { wrapper = shallowMount(NodeErrorHelpText, { propsData, stubs: { GlPopover } }); - return wrapper.vm.$nextTick(); + await nextTick(); }; const findPopover = () => wrapper.find(GlPopover); |