Use new shared Vue mountComponent method
This commit is contained in:
parent
5fd3ec1cfc
commit
f2c23ab894
1 changed files with 5 additions and 15 deletions
|
@ -1,19 +1,9 @@
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import conflictsComponent from '~/vue_merge_request_widget/components/states/mr_widget_conflicts';
|
import conflictsComponent from '~/vue_merge_request_widget/components/states/mr_widget_conflicts';
|
||||||
|
import mountComponent from '../../../helpers/vue_mount_component_helper';
|
||||||
|
|
||||||
|
const ConflictsComponent = Vue.extend(conflictsComponent);
|
||||||
const path = '/conflicts';
|
const path = '/conflicts';
|
||||||
const createComponent = (customConfig = {}) => {
|
|
||||||
const Component = Vue.extend(conflictsComponent);
|
|
||||||
|
|
||||||
const config = Object.assign({
|
|
||||||
mr: {},
|
|
||||||
}, customConfig);
|
|
||||||
|
|
||||||
return new Component({
|
|
||||||
el: document.createElement('div'),
|
|
||||||
propsData: config,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
describe('MRWidgetConflicts', () => {
|
describe('MRWidgetConflicts', () => {
|
||||||
describe('props', () => {
|
describe('props', () => {
|
||||||
|
@ -30,7 +20,7 @@ describe('MRWidgetConflicts', () => {
|
||||||
let vm;
|
let vm;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
vm = createComponent({
|
vm = mountComponent(ConflictsComponent, {
|
||||||
mr: {
|
mr: {
|
||||||
canMerge: true,
|
canMerge: true,
|
||||||
conflictResolutionPath: path,
|
conflictResolutionPath: path,
|
||||||
|
@ -65,7 +55,7 @@ describe('MRWidgetConflicts', () => {
|
||||||
let vm;
|
let vm;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
vm = createComponent({
|
vm = mountComponent(ConflictsComponent, {
|
||||||
mr: {
|
mr: {
|
||||||
canMerge: false,
|
canMerge: false,
|
||||||
},
|
},
|
||||||
|
@ -87,7 +77,7 @@ describe('MRWidgetConflicts', () => {
|
||||||
let vm;
|
let vm;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
vm = createComponent({
|
vm = mountComponent(ConflictsComponent, {
|
||||||
mr: {
|
mr: {
|
||||||
ffOnlyEnabled: true,
|
ffOnlyEnabled: true,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue