diff options
Diffstat (limited to 'spec/frontend/create_cluster/eks_cluster/components/service_credentials_form_spec.js')
-rw-r--r-- | spec/frontend/create_cluster/eks_cluster/components/service_credentials_form_spec.js | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/spec/frontend/create_cluster/eks_cluster/components/service_credentials_form_spec.js b/spec/frontend/create_cluster/eks_cluster/components/service_credentials_form_spec.js index a0510d46794..0d823a18012 100644 --- a/spec/frontend/create_cluster/eks_cluster/components/service_credentials_form_spec.js +++ b/spec/frontend/create_cluster/eks_cluster/components/service_credentials_form_spec.js @@ -1,11 +1,11 @@ import { GlButton } from '@gitlab/ui'; -import { shallowMount, createLocalVue } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; +import Vue, { nextTick } from 'vue'; import Vuex from 'vuex'; import ServiceCredentialsForm from '~/create_cluster/eks_cluster/components/service_credentials_form.vue'; import eksClusterState from '~/create_cluster/eks_cluster/store/state'; -const localVue = createLocalVue(); -localVue.use(Vuex); +Vue.use(Vuex); describe('ServiceCredentialsForm', () => { let vm; @@ -33,7 +33,6 @@ describe('ServiceCredentialsForm', () => { createRoleArnHelpPath: '', externalLinkIcon: '', }, - localVue, store, }); }); @@ -66,14 +65,13 @@ describe('ServiceCredentialsForm', () => { expect(findSubmitButton().attributes('disabled')).toBeTruthy(); }); - it('enables submit button when role ARN is not provided', () => { + it('enables submit button when role ARN is not provided', async () => { // setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details // eslint-disable-next-line no-restricted-syntax vm.setData({ roleArn: '123' }); - return vm.vm.$nextTick().then(() => { - expect(findSubmitButton().attributes('disabled')).toBeFalsy(); - }); + await nextTick(); + expect(findSubmitButton().attributes('disabled')).toBeFalsy(); }); it('dispatches createRole action when submit button is clicked', () => { @@ -87,14 +85,14 @@ describe('ServiceCredentialsForm', () => { }); describe('when is creating role', () => { - beforeEach(() => { + beforeEach(async () => { // setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details // eslint-disable-next-line no-restricted-syntax vm.setData({ roleArn: '123' }); // set role ARN to enable button state.isCreatingRole = true; - return vm.vm.$nextTick(); + await nextTick(); }); it('disables submit button', () => { |