diff options
Diffstat (limited to 'spec/frontend/user_lists/components/new_user_list_spec.js')
-rw-r--r-- | spec/frontend/user_lists/components/new_user_list_spec.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/spec/frontend/user_lists/components/new_user_list_spec.js b/spec/frontend/user_lists/components/new_user_list_spec.js index a81e8912714..5eb44970fe4 100644 --- a/spec/frontend/user_lists/components/new_user_list_spec.js +++ b/spec/frontend/user_lists/components/new_user_list_spec.js @@ -1,6 +1,6 @@ import { GlAlert } from '@gitlab/ui'; -import { mount, createLocalVue } 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'; @@ -12,8 +12,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/new_user_list', () => { let wrapper; @@ -24,7 +23,6 @@ describe('user_lists/components/new_user_list', () => { beforeEach(() => { wrapper = mount(NewUserList, { - localVue, store: createStore({ projectId: '1' }), provide: { featureFlagsPath: '/feature_flags', @@ -45,11 +43,11 @@ describe('user_lists/components/new_user_list', () => { describe('create', () => { describe('success', () => { - beforeEach(() => { + beforeEach(async () => { Api.createFeatureFlagUserList.mockResolvedValue({ data: userList }); setInputValue('test'); click('save-user-list'); - return wrapper.vm.$nextTick(); + await nextTick(); }); it('should create a user list with the entered name', () => { @@ -84,7 +82,7 @@ describe('user_lists/components/new_user_list', () => { it('should dismiss the error when the dismiss button is clicked', async () => { alert.find('button').trigger('click'); - await wrapper.vm.$nextTick(); + await nextTick(); expect(alert.exists()).toBe(false); }); |