Commit 05154727 authored by Illya Klymov's avatar Illya Klymov

Stop using strings for VTU stubs

@vuu/test-utils 1.x deprecated using strings for stubs
This MR makes fixes such deprecations
parent 81265090
......@@ -42,7 +42,7 @@ describe('Environments', () => {
beforeAll(() => {
wrapper = mount(Environments, {
propsData: { ...propsData, environments },
stubs: { deploymentInstance: '<div class="js-deployment-instance"></div>' },
stubs: { deploymentInstance: { template: '<div class="js-deployment-instance"></div>' } },
});
table = wrapper.find(GlTable);
......
......@@ -27,7 +27,7 @@ describe('ee/epic/components/epic_form.vue', () => {
},
stubs: {
ApolloMutation,
MarkdownField: '<div><slot name="textarea"></slot></div>',
MarkdownField: { template: '<div><slot name="textarea"></slot></div>' },
},
mocks: {
$apollo: {
......
......@@ -37,7 +37,7 @@ describe('Iteration Form', () => {
propsData: props,
stubs: {
ApolloMutation,
MarkdownField: '<div><slot name="textarea"></slot></div>',
MarkdownField: { template: '<div><slot name="textarea"></slot></div>' },
},
mocks: {
$apollo: {
......
......@@ -233,7 +233,7 @@ describe('AlertDetails', () => {
describe('header', () => {
const findHeader = () => wrapper.find('[data-testid="alert-header"]');
const stubs = { TimeAgoTooltip: '<span>now</span>' };
const stubs = { TimeAgoTooltip: { template: '<span>now</span>' } };
describe('individual header fields', () => {
describe.each`
......
......@@ -31,7 +31,7 @@ describe('Suggest gitlab-ci.yml Popover', () => {
humanAccess,
},
stubs: {
'gl-popover': '<div><slot name="title"></slot><slot></slot></div>',
'gl-popover': { template: '<div><slot name="title"></slot><slot></slot></div>' },
},
});
}
......
......@@ -71,14 +71,14 @@ describe('Embed Group', () => {
it('is expanded by default', () => {
metricsWithDataGetter.mockReturnValue([1]);
mountComponent({ shallow: false, stubs: { MetricEmbed: '<div />' } });
mountComponent({ shallow: false, stubs: { MetricEmbed: true } });
expect(wrapper.find('.card-body').classes()).not.toContain('d-none');
});
it('collapses when clicked', done => {
metricsWithDataGetter.mockReturnValue([1]);
mountComponent({ shallow: false, stubs: { MetricEmbed: '<div />' } });
mountComponent({ shallow: false, stubs: { MetricEmbed: true } });
wrapper.find(GlButton).trigger('click');
......@@ -148,14 +148,14 @@ describe('Embed Group', () => {
describe('button text', () => {
it('has a singular label when there is one embed', () => {
metricsWithDataGetter.mockReturnValue([1]);
mountComponent({ shallow: false, stubs: { MetricEmbed: '<div />' } });
mountComponent({ shallow: false, stubs: { MetricEmbed: true } });
expect(wrapper.find(GlButton).text()).toBe('Hide chart');
});
it('has a plural label when there are multiple embeds', () => {
metricsWithDataGetter.mockReturnValue([2]);
mountComponent({ shallow: false, stubs: { MetricEmbed: '<div />' } });
mountComponent({ shallow: false, stubs: { MetricEmbed: true } });
expect(wrapper.find(GlButton).text()).toBe('Hide charts');
});
......
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