diff options
Diffstat (limited to 'spec/frontend/error_tracking_settings')
3 files changed, 18 insertions, 23 deletions
diff --git a/spec/frontend/error_tracking_settings/components/app_spec.js b/spec/frontend/error_tracking_settings/components/app_spec.js index 844faff64a1..4d19ec047ef 100644 --- a/spec/frontend/error_tracking_settings/components/app_spec.js +++ b/spec/frontend/error_tracking_settings/components/app_spec.js @@ -1,6 +1,6 @@ import { GlFormRadioGroup, GlFormRadio, GlFormInputGroup } from '@gitlab/ui'; -import { createLocalVue, shallowMount } from '@vue/test-utils'; -import { nextTick } from 'vue'; +import { shallowMount } from '@vue/test-utils'; +import Vue, { nextTick } from 'vue'; import Vuex from 'vuex'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import { TEST_HOST } from 'helpers/test_constants'; @@ -10,8 +10,7 @@ import ErrorTrackingForm from '~/error_tracking_settings/components/error_tracki import ProjectDropdown from '~/error_tracking_settings/components/project_dropdown.vue'; import createStore from '~/error_tracking_settings/store'; -const localVue = createLocalVue(); -localVue.use(Vuex); +Vue.use(Vuex); const TEST_GITLAB_DSN = 'https://gitlab.example.com/123456'; @@ -22,7 +21,6 @@ describe('error tracking settings app', () => { function mountComponent() { wrapper = extendedWrapper( shallowMount(ErrorTrackingSettings, { - localVue, store, // Override the imported store propsData: { initialEnabled: 'true', @@ -81,12 +79,11 @@ describe('error tracking settings app', () => { expect(wrapper.find('.js-error-tracking-button').attributes('disabled')).toBeFalsy(); }); - it('disables the button when saving', () => { + it('disables the button when saving', async () => { store.state.settingsLoading = true; - return wrapper.vm.$nextTick(() => { - expect(wrapper.find('.js-error-tracking-button').attributes('disabled')).toBeTruthy(); - }); + await nextTick(); + expect(wrapper.find('.js-error-tracking-button').attributes('disabled')).toBeTruthy(); }); }); diff --git a/spec/frontend/error_tracking_settings/components/error_tracking_form_spec.js b/spec/frontend/error_tracking_settings/components/error_tracking_form_spec.js index 2e8a42dbfe6..69d684faec2 100644 --- a/spec/frontend/error_tracking_settings/components/error_tracking_form_spec.js +++ b/spec/frontend/error_tracking_settings/components/error_tracking_form_spec.js @@ -1,12 +1,12 @@ import { GlFormInput, GlButton } from '@gitlab/ui'; -import { createLocalVue, shallowMount } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; +import Vue from 'vue'; import Vuex from 'vuex'; import ErrorTrackingForm from '~/error_tracking_settings/components/error_tracking_form.vue'; import createStore from '~/error_tracking_settings/store'; import { defaultProps } from '../mock'; -const localVue = createLocalVue(); -localVue.use(Vuex); +Vue.use(Vuex); describe('error tracking settings form', () => { let wrapper; @@ -14,7 +14,6 @@ describe('error tracking settings form', () => { function mountComponent() { wrapper = shallowMount(ErrorTrackingForm, { - localVue, store, propsData: defaultProps, }); diff --git a/spec/frontend/error_tracking_settings/components/project_dropdown_spec.js b/spec/frontend/error_tracking_settings/components/project_dropdown_spec.js index 79518a487d4..1ba5a505f57 100644 --- a/spec/frontend/error_tracking_settings/components/project_dropdown_spec.js +++ b/spec/frontend/error_tracking_settings/components/project_dropdown_spec.js @@ -1,19 +1,18 @@ import { GlDropdown, GlDropdownItem } from '@gitlab/ui'; -import { createLocalVue, shallowMount } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; +import Vue, { nextTick } from 'vue'; import { pick, clone } from 'lodash'; import Vuex from 'vuex'; import ProjectDropdown from '~/error_tracking_settings/components/project_dropdown.vue'; import { defaultProps, projectList, staleProject } from '../mock'; -const localVue = createLocalVue(); -localVue.use(Vuex); +Vue.use(Vuex); describe('error tracking settings project dropdown', () => { let wrapper; function mountComponent() { wrapper = shallowMount(ProjectDropdown, { - localVue, propsData: { ...pick( defaultProps, @@ -64,10 +63,10 @@ describe('error tracking settings project dropdown', () => { }); describe('populated project list', () => { - beforeEach(() => { + beforeEach(async () => { wrapper.setProps({ projects: clone(projectList), hasProjects: true }); - return wrapper.vm.$nextTick(); + await nextTick(); }); it('renders the dropdown', () => { @@ -84,9 +83,9 @@ describe('error tracking settings project dropdown', () => { describe('selected project', () => { const selectedProject = clone(projectList[0]); - beforeEach(() => { + beforeEach(async () => { wrapper.setProps({ projects: clone(projectList), selectedProject, hasProjects: true }); - return wrapper.vm.$nextTick(); + await nextTick(); }); it('does not show helper text', () => { @@ -96,13 +95,13 @@ describe('error tracking settings project dropdown', () => { }); describe('invalid project selected', () => { - beforeEach(() => { + beforeEach(async () => { wrapper.setProps({ projects: clone(projectList), selectedProject: staleProject, isProjectInvalid: true, }); - return wrapper.vm.$nextTick(); + await nextTick(); }); it('displays a error', () => { |