Commit 3bec480b authored by Phil Hughes's avatar Phil Hughes

Merge branch 'upgrade-bootstrap-vue/upgrade-vue-shared-tests' into 'master'

Prepare vue_shared specs for bv upgrade

See merge request gitlab-org/gitlab!20240
parents aff240cb 7ff48a38
...@@ -19,6 +19,7 @@ describe('Changed file icon', () => { ...@@ -19,6 +19,7 @@ describe('Changed file icon', () => {
...props, ...props,
}, },
sync: false, sync: false,
attachToDocument: true,
}); });
}; };
......
...@@ -13,6 +13,7 @@ describe('Commit component', () => { ...@@ -13,6 +13,7 @@ describe('Commit component', () => {
wrapper = shallowMount(CommitComponent, { wrapper = shallowMount(CommitComponent, {
propsData, propsData,
sync: false, sync: false,
attachToDocument: true,
}); });
}; };
......
...@@ -18,6 +18,7 @@ describe('IssueAssigneesComponent', () => { ...@@ -18,6 +18,7 @@ describe('IssueAssigneesComponent', () => {
...props, ...props,
}, },
sync: false, sync: false,
attachToDocument: true,
}); });
vm = wrapper.vm; // eslint-disable-line vm = wrapper.vm; // eslint-disable-line
}; };
......
import Vue from 'vue'; import Vue from 'vue';
import { mount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import IssueMilestone from '~/vue_shared/components/issue/issue_milestone.vue'; import IssueMilestone from '~/vue_shared/components/issue/issue_milestone.vue';
import Icon from '~/vue_shared/components/icon.vue';
import { mockMilestone } from '../../../../javascripts/boards/mock_data'; import { mockMilestone } from '../../../../javascripts/boards/mock_data';
const createComponent = (milestone = mockMilestone) => { const createComponent = (milestone = mockMilestone) => {
const Component = Vue.extend(IssueMilestone); const Component = Vue.extend(IssueMilestone);
return mount(Component, { return shallowMount(Component, {
propsData: { propsData: {
milestone, milestone,
}, },
sync: false, sync: false,
attachToDocument: true,
}); });
}; };
...@@ -156,7 +158,7 @@ describe('IssueMilestoneComponent', () => { ...@@ -156,7 +158,7 @@ describe('IssueMilestoneComponent', () => {
}); });
it('renders milestone icon', () => { it('renders milestone icon', () => {
expect(vm.$el.querySelector('svg use').getAttribute('xlink:href')).toContain('clock'); expect(wrapper.find(Icon).props('name')).toBe('clock');
}); });
it('renders milestone title', () => { it('renders milestone title', () => {
......
...@@ -35,6 +35,7 @@ describe('RelatedIssuableItem', () => { ...@@ -35,6 +35,7 @@ describe('RelatedIssuableItem', () => {
localVue, localVue,
slots, slots,
sync: false, sync: false,
attachToDocument: true,
propsData: props, propsData: props,
}); });
}); });
......
...@@ -21,6 +21,7 @@ describe('Suggestion Diff component', () => { ...@@ -21,6 +21,7 @@ describe('Suggestion Diff component', () => {
}, },
localVue, localVue,
sync: false, sync: false,
attachToDocument: true,
}); });
}; };
......
...@@ -16,6 +16,8 @@ describe('modal copy button', () => { ...@@ -16,6 +16,8 @@ describe('modal copy button', () => {
text: 'copy me', text: 'copy me',
title: 'Copy this value', title: 'Copy this value',
}, },
attachToDocument: true,
sync: false,
}); });
}); });
......
...@@ -26,6 +26,8 @@ describe('Pagination links component', () => { ...@@ -26,6 +26,8 @@ describe('Pagination links component', () => {
list: [{ id: 'foo' }, { id: 'bar' }], list: [{ id: 'foo' }, { id: 'bar' }],
props, props,
}, },
attachToDocument: true,
sync: false,
}); });
[glPaginatedList] = wrapper.vm.$children; [glPaginatedList] = wrapper.vm.$children;
......
import Vue from 'vue'; import Vue from 'vue';
import LabelsSelect from '~/labels_select'; import LabelsSelect from '~/labels_select';
import baseComponent from '~/vue_shared/components/sidebar/labels_select/base.vue'; import BaseComponent from '~/vue_shared/components/sidebar/labels_select/base.vue';
import { mount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { import {
mockConfig, mockConfig,
mockLabels, mockLabels,
} from '../../../../../javascripts/vue_shared/components/sidebar/labels_select/mock_data'; } from '../../../../../javascripts/vue_shared/components/sidebar/labels_select/mock_data';
const createComponent = (config = mockConfig) => { const createComponent = (config = mockConfig) =>
const Component = Vue.extend(baseComponent); shallowMount(BaseComponent, {
return mount(Component, {
propsData: config, propsData: config,
sync: false, sync: false,
attachToDocument: true,
}); });
};
describe('BaseComponent', () => { describe('BaseComponent', () => {
let wrapper; let wrapper;
......
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