Commit 44739602 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'xanf-remove-localVue-121739' into 'master'

Remove incorrect localVue usage in ee/spec/frontend/vue_mr_widget

Closes #121739

See merge request gitlab-org/gitlab!22594
parents bc5eaa39 554d6030
import _ from 'underscore';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import { GlButton, GlLoadingIcon } from '@gitlab/ui';
import ApprovalsList from 'ee/vue_merge_request_widget/components/approvals/approvals_list.vue';
import ApprovalsFooter from 'ee/vue_merge_request_widget/components/approvals/approvals_footer.vue';
import Icon from '~/vue_shared/components/icon.vue';
import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue';
const localVue = createLocalVue();
const testSuggestedApprovers = () => _.range(1, 11).map(id => ({ id }));
const testApprovalRules = () => [{ name: 'Lorem' }, { name: 'Ipsum' }];
......@@ -15,13 +13,12 @@ describe('EE MRWidget approvals footer', () => {
let wrapper;
const createComponent = (props = {}) => {
wrapper = shallowMount(localVue.extend(ApprovalsFooter), {
wrapper = shallowMount(ApprovalsFooter, {
propsData: {
suggestedApprovers: testSuggestedApprovers(),
approvalRules: testApprovalRules(),
...props,
},
localVue,
sync: false,
});
};
......@@ -190,8 +187,8 @@ describe('EE MRWidget approvals footer', () => {
button.vm.$emit('click');
localVue
.nextTick()
wrapper.vm
.$nextTick()
.then(() => {
expect(wrapper.emittedByOrder()).toEqual([{ name: 'input', args: [true] }]);
})
......
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import _ from 'underscore';
import ApprovedIcon from 'ee/vue_merge_request_widget/components/approvals/approved_icon.vue';
import ApprovalsList from 'ee/vue_merge_request_widget/components/approvals/approvals_list.vue';
import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue';
const localVue = createLocalVue();
const testApprovers = () => _.range(1, 11).map(id => ({ id }));
const testRuleApproved = () => ({
id: 1,
......@@ -57,9 +55,8 @@ describe('EE MRWidget approvals list', () => {
let wrapper;
const createComponent = (props = {}) => {
wrapper = shallowMount(localVue.extend(ApprovalsList), {
wrapper = shallowMount(ApprovalsList, {
propsData: props,
localVue,
sync: false,
});
};
......
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import { GlLink } from '@gitlab/ui';
import {
OPTIONAL,
......@@ -6,18 +6,15 @@ import {
} from 'ee/vue_merge_request_widget/components/approvals/messages';
import ApprovalsSummaryOptional from 'ee/vue_merge_request_widget/components/approvals/approvals_summary_optional.vue';
const localVue = createLocalVue();
const TEST_HELP_PATH = 'help/path';
describe('EE MRWidget approvals summary optional', () => {
let wrapper;
const createComponent = (props = {}) => {
wrapper = shallowMount(localVue.extend(ApprovalsSummaryOptional), {
wrapper = shallowMount(ApprovalsSummaryOptional, {
propsData: props,
sync: false,
localVue,
attachToDocument: true,
});
};
......
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import _ from 'underscore';
import { APPROVED_MESSAGE } from 'ee/vue_merge_request_widget/components/approvals/messages';
import ApprovalsSummary from 'ee/vue_merge_request_widget/components/approvals/approvals_summary.vue';
import { toNounSeriesText } from '~/lib/utils/grammar';
import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue';
const localVue = createLocalVue();
const testApprovers = () => _.range(1, 5).map(id => ({ id }));
const testRulesLeft = () => ['Lorem', 'Ipsum', 'dolar sit'];
const TEST_APPROVALS_LEFT = 3;
......@@ -15,7 +13,7 @@ describe('EE MRWidget approvals summary', () => {
let wrapper;
const createComponent = (props = {}) => {
wrapper = shallowMount(localVue.extend(ApprovalsSummary), {
wrapper = shallowMount(ApprovalsSummary, {
propsData: {
approved: false,
approvers: testApprovers(),
......@@ -23,7 +21,6 @@ describe('EE MRWidget approvals summary', () => {
rulesLeft: testRulesLeft(),
...props,
},
localVue,
sync: false,
});
};
......
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import ApprovedIcon from 'ee/vue_merge_request_widget/components/approvals/approved_icon.vue';
import Icon from '~/vue_shared/components/icon.vue';
const localVue = createLocalVue();
const EXPECTED_SIZE = 16;
describe('EE MRWidget approved icon', () => {
let wrapper;
const createComponent = (props = {}) => {
wrapper = shallowMount(localVue.extend(ApprovedIcon), {
wrapper = shallowMount(ApprovedIcon, {
propsData: props,
localVue,
sync: false,
});
};
......
import { createLocalVue, shallowMount, config } from '@vue/test-utils';
import { shallowMount, config } from '@vue/test-utils';
import BlockingMergeRequestsReport from 'ee/vue_merge_request_widget/components/blocking_merge_requests/blocking_merge_requests_report.vue';
import ReportSection from '~/reports/components/report_section.vue';
import { status as reportStatus } from '~/reports/constants';
const localVue = createLocalVue();
describe('BlockingMergeRequestsReport', () => {
let wrapper;
let props;
......@@ -42,7 +40,6 @@ describe('BlockingMergeRequestsReport', () => {
const createComponent = (propsData = props) => {
wrapper = shallowMount(BlockingMergeRequestsReport, {
propsData,
localVue,
});
};
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import { GlLink } from '@gitlab/ui';
import { trimText } from 'helpers/text_helper';
import MergeTrainHelperText from 'ee/vue_merge_request_widget/components/merge_train_helper_text.vue';
describe('MergeTrainHelperText', () => {
const localVue = createLocalVue();
let wrapper;
const factory = propsData => {
wrapper = shallowMount(localVue.extend(MergeTrainHelperText), {
wrapper = shallowMount(MergeTrainHelperText, {
propsData,
localVue,
sync: false,
});
};
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import { trimText } from 'helpers/text_helper';
import MergeTrainPositionIndicator from 'ee/vue_merge_request_widget/components/merge_train_position_indicator.vue';
describe('MergeTrainPositionIndicator', () => {
const localVue = createLocalVue();
let wrapper;
let vm;
const factory = propsData => {
wrapper = shallowMount(localVue.extend(MergeTrainPositionIndicator), {
wrapper = shallowMount(MergeTrainPositionIndicator, {
propsData,
localVue,
sync: false,
});
......
......@@ -43,7 +43,7 @@ describe('ReadyToMerge', () => {
};
const factory = (mrUpdates = {}) => {
wrapper = shallowMount(localVue.extend(ReadyToMerge), {
wrapper = shallowMount(ReadyToMerge, {
propsData: {
mr: { ...mr, ...mrUpdates },
service,
......
import { shallowMount, mount, createLocalVue } from '@vue/test-utils';
import { shallowMount, mount } from '@vue/test-utils';
import VisualReviewAppLink from 'ee/vue_merge_request_widget/components/visual_review_app_link.vue';
import { GlButton, GlModal } from '@gitlab/ui';
import { mockTracking, triggerEvent } from 'helpers/tracking_helper';
import ModalCopyButton from '~/vue_shared/components/modal_copy_button.vue';
const localVue = createLocalVue();
describe('Visual Review App Link', () => {
const Component = localVue.extend(VisualReviewAppLink);
let wrapper;
let propsData;
......@@ -30,9 +27,8 @@ describe('Visual Review App Link', () => {
describe('renders link and text', () => {
beforeEach(() => {
wrapper = mount(Component, {
wrapper = mount(VisualReviewAppLink, {
propsData,
localVue,
});
});
......@@ -49,9 +45,8 @@ describe('Visual Review App Link', () => {
describe('renders the modal', () => {
beforeEach(() => {
wrapper = shallowMount(Component, {
wrapper = shallowMount(VisualReviewAppLink, {
propsData,
localVue,
});
});
it('with expected project Id', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment