diff options
Diffstat (limited to 'spec/frontend/user_lists/components/edit_user_list_spec.js')
-rw-r--r-- | spec/frontend/user_lists/components/edit_user_list_spec.js | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/spec/frontend/user_lists/components/edit_user_list_spec.js b/spec/frontend/user_lists/components/edit_user_list_spec.js index bd71a677a24..7cafe5e1f56 100644 --- a/spec/frontend/user_lists/components/edit_user_list_spec.js +++ b/spec/frontend/user_lists/components/edit_user_list_spec.js @@ -1,6 +1,6 @@ import { GlAlert, GlLoadingIcon } from '@gitlab/ui'; -import { createLocalVue, mount } from '@vue/test-utils'; -import Vue from 'vue'; +import { mount } from '@vue/test-utils'; +import Vue, { nextTick } from 'vue'; import Vuex from 'vuex'; import waitForPromises from 'helpers/wait_for_promises'; import Api from '~/api'; @@ -13,8 +13,7 @@ import { userList } from '../../feature_flags/mock_data'; jest.mock('~/api'); jest.mock('~/lib/utils/url_utility'); -const localVue = createLocalVue(Vue); -localVue.use(Vuex); +Vue.use(Vuex); describe('user_lists/components/edit_user_list', () => { let wrapper; @@ -30,7 +29,6 @@ describe('user_lists/components/edit_user_list', () => { destroy(); wrapper = mount(EditUserList, { - localVue, store: createStore({ projectId: '1', userListIid: '2' }), provide: { userListsDocsPath: '/docs/user_lists', @@ -79,11 +77,11 @@ describe('user_lists/components/edit_user_list', () => { }); describe('update', () => { - beforeEach(() => { + beforeEach(async () => { Api.fetchFeatureFlagUserList.mockResolvedValue({ data: userList }); factory(); - return wrapper.vm.$nextTick(); + await nextTick(); }); it('should link to the documentation', () => { @@ -101,11 +99,11 @@ describe('user_lists/components/edit_user_list', () => { }); describe('success', () => { - beforeEach(() => { + beforeEach(async () => { Api.updateFeatureFlagUserList.mockResolvedValue({ data: userList }); setInputValue('test'); clickSave(); - return wrapper.vm.$nextTick(); + await nextTick(); }); it('should create a user list with the entered name', () => { @@ -141,7 +139,7 @@ describe('user_lists/components/edit_user_list', () => { it('should dismiss the error if dismiss is clicked', async () => { alert.find('button').trigger('click'); - await wrapper.vm.$nextTick(); + await nextTick(); expect(alert.exists()).toBe(false); }); |