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