Commit 9b967078 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch 'xanf-vtu-string-stubs' into 'master'

Stop using strings for VTU stubs

See merge request gitlab-org/gitlab!40673
parents 6e73a1ad 05154727
...@@ -42,7 +42,7 @@ describe('Environments', () => { ...@@ -42,7 +42,7 @@ describe('Environments', () => {
beforeAll(() => { beforeAll(() => {
wrapper = mount(Environments, { wrapper = mount(Environments, {
propsData: { ...propsData, 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); table = wrapper.find(GlTable);
......
...@@ -27,7 +27,7 @@ describe('ee/epic/components/epic_form.vue', () => { ...@@ -27,7 +27,7 @@ describe('ee/epic/components/epic_form.vue', () => {
}, },
stubs: { stubs: {
ApolloMutation, ApolloMutation,
MarkdownField: '<div><slot name="textarea"></slot></div>', MarkdownField: { template: '<div><slot name="textarea"></slot></div>' },
}, },
mocks: { mocks: {
$apollo: { $apollo: {
......
...@@ -37,7 +37,7 @@ describe('Iteration Form', () => { ...@@ -37,7 +37,7 @@ describe('Iteration Form', () => {
propsData: props, propsData: props,
stubs: { stubs: {
ApolloMutation, ApolloMutation,
MarkdownField: '<div><slot name="textarea"></slot></div>', MarkdownField: { template: '<div><slot name="textarea"></slot></div>' },
}, },
mocks: { mocks: {
$apollo: { $apollo: {
......
...@@ -233,7 +233,7 @@ describe('AlertDetails', () => { ...@@ -233,7 +233,7 @@ describe('AlertDetails', () => {
describe('header', () => { describe('header', () => {
const findHeader = () => wrapper.find('[data-testid="alert-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('individual header fields', () => {
describe.each` describe.each`
......
...@@ -31,7 +31,7 @@ describe('Suggest gitlab-ci.yml Popover', () => { ...@@ -31,7 +31,7 @@ describe('Suggest gitlab-ci.yml Popover', () => {
humanAccess, humanAccess,
}, },
stubs: { 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', () => { ...@@ -71,14 +71,14 @@ describe('Embed Group', () => {
it('is expanded by default', () => { it('is expanded by default', () => {
metricsWithDataGetter.mockReturnValue([1]); 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'); expect(wrapper.find('.card-body').classes()).not.toContain('d-none');
}); });
it('collapses when clicked', done => { it('collapses when clicked', done => {
metricsWithDataGetter.mockReturnValue([1]); metricsWithDataGetter.mockReturnValue([1]);
mountComponent({ shallow: false, stubs: { MetricEmbed: '<div />' } }); mountComponent({ shallow: false, stubs: { MetricEmbed: true } });
wrapper.find(GlButton).trigger('click'); wrapper.find(GlButton).trigger('click');
...@@ -148,14 +148,14 @@ describe('Embed Group', () => { ...@@ -148,14 +148,14 @@ describe('Embed Group', () => {
describe('button text', () => { describe('button text', () => {
it('has a singular label when there is one embed', () => { it('has a singular label when there is one embed', () => {
metricsWithDataGetter.mockReturnValue([1]); metricsWithDataGetter.mockReturnValue([1]);
mountComponent({ shallow: false, stubs: { MetricEmbed: '<div />' } }); mountComponent({ shallow: false, stubs: { MetricEmbed: true } });
expect(wrapper.find(GlButton).text()).toBe('Hide chart'); expect(wrapper.find(GlButton).text()).toBe('Hide chart');
}); });
it('has a plural label when there are multiple embeds', () => { it('has a plural label when there are multiple embeds', () => {
metricsWithDataGetter.mockReturnValue([2]); metricsWithDataGetter.mockReturnValue([2]);
mountComponent({ shallow: false, stubs: { MetricEmbed: '<div />' } }); mountComponent({ shallow: false, stubs: { MetricEmbed: true } });
expect(wrapper.find(GlButton).text()).toBe('Hide charts'); 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