Commit 545e53df authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'xanf-vtu-v1-strings-as-stubs' into 'master'

Upgrading VTU to v1: Remove deprecated strings as stubs

See merge request gitlab-org/gitlab!50514
parents c15d8be4 44a32e5a
import { GlDrawer } from '@gitlab/ui'; import { GlDrawer } from '@gitlab/ui';
import { mount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import BoardContentSidebar from 'ee_component/boards/components/board_content_sidebar.vue'; import BoardContentSidebar from 'ee_component/boards/components/board_content_sidebar.vue';
import { stubComponent } from 'helpers/stub_component';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import BoardAssigneeDropdown from '~/boards/components/board_assignee_dropdown.vue'; import BoardAssigneeDropdown from '~/boards/components/board_assignee_dropdown.vue';
import IssuableTitle from '~/boards/components/issuable_title.vue'; import IssuableTitle from '~/boards/components/issuable_title.vue';
...@@ -12,20 +13,16 @@ describe('ee/BoardContentSidebar', () => { ...@@ -12,20 +13,16 @@ describe('ee/BoardContentSidebar', () => {
let store; let store;
const createComponent = () => { const createComponent = () => {
wrapper = mount(BoardContentSidebar, { wrapper = shallowMount(BoardContentSidebar, {
provide: { provide: {
canUpdate: true, canUpdate: true,
rootPath: '', rootPath: '',
}, },
store, store,
stubs: { stubs: {
'board-sidebar-epic-select': '<div></div>', GlDrawer: stubComponent(GlDrawer, {
'board-sidebar-time-tracker': '<div></div>', template: '<div><slot name="header"></slot><slot></slot></div>',
'board-sidebar-weight-input': '<div></div>', }),
'board-sidebar-labels-select': '<div></div>',
'board-sidebar-due-date': '<div></div>',
'board-sidebar-subscription': '<div></div>',
'board-sidebar-milestone-select': '<div></div>',
}, },
mocks: { mocks: {
$apollo: { $apollo: {
...@@ -62,7 +59,7 @@ describe('ee/BoardContentSidebar', () => { ...@@ -62,7 +59,7 @@ describe('ee/BoardContentSidebar', () => {
}); });
it('finds IssuableTitle', () => { it('finds IssuableTitle', () => {
expect(wrapper.find(IssuableTitle).text()).toContain('One'); expect(wrapper.find(IssuableTitle).props('title')).toContain('One');
}); });
it('renders BoardAssigneeDropdown', () => { it('renders BoardAssigneeDropdown', () => {
......
...@@ -10,13 +10,14 @@ describe('PipelineTourSuccessModal', () => { ...@@ -10,13 +10,14 @@ describe('PipelineTourSuccessModal', () => {
let cookieSpy; let cookieSpy;
let trackingSpy; let trackingSpy;
const GlEmoji = { template: '<img/>' };
const createComponent = () => { const createComponent = () => {
wrapper = shallowMount(pipelineTourSuccess, { wrapper = shallowMount(pipelineTourSuccess, {
propsData: modalProps, propsData: modalProps,
stubs: { stubs: {
GlModal, GlModal,
GlSprintf, GlSprintf,
'gl-emoji': '<img/>', GlEmoji,
}, },
}); });
}; };
...@@ -67,7 +68,7 @@ describe('PipelineTourSuccessModal', () => { ...@@ -67,7 +68,7 @@ describe('PipelineTourSuccessModal', () => {
it('has expected structure', () => { it('has expected structure', () => {
const modal = wrapper.find(GlModal); const modal = wrapper.find(GlModal);
const sprintf = modal.find(GlSprintf); const sprintf = modal.find(GlSprintf);
const emoji = modal.find('img'); const emoji = modal.find(GlEmoji);
expect(wrapper.text()).toContain("That's it, well done!"); expect(wrapper.text()).toContain("That's it, well done!");
expect(sprintf.exists()).toBe(true); expect(sprintf.exists()).toBe(true);
......
...@@ -37,8 +37,8 @@ describe('~/boards/components/sidebar/board_sidebar_labels_select.vue', () => { ...@@ -37,8 +37,8 @@ describe('~/boards/components/sidebar/board_sidebar_labels_select.vue', () => {
labelsFilterBasePath: TEST_HOST, labelsFilterBasePath: TEST_HOST,
}, },
stubs: { stubs: {
'board-editable-item': BoardEditableItem, BoardEditableItem,
'labels-select': '<div></div>', LabelsSelect: true,
}, },
}); });
}; };
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlLink } from '@gitlab/ui'; import { GlLink, GlModal } from '@gitlab/ui';
import { mockTracking, unmockTracking, triggerEvent } from 'helpers/tracking_helper'; import { mockTracking, unmockTracking, triggerEvent } from 'helpers/tracking_helper';
import { stubComponent } from 'helpers/stub_component';
import InviteMemberModal from '~/invite_member/components/invite_member_modal.vue'; import InviteMemberModal from '~/invite_member/components/invite_member_modal.vue';
const memberPath = 'member_path'; const memberPath = 'member_path';
const GlEmoji = { template: '<img />' };
const createComponent = () => { const createComponent = () => {
return shallowMount(InviteMemberModal, { return shallowMount(InviteMemberModal, {
provide: { provide: {
membersPath: memberPath, membersPath: memberPath,
}, },
stubs: { stubs: {
'gl-emoji': '<img/>', GlEmoji,
'gl-modal': '<div><slot name="modal-title"></slot><slot></slot></div>', GlModal: stubComponent(GlModal, {
template: '<div><slot name="modal-title"></slot><slot></slot></div>',
}),
}, },
}); });
}; };
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlDropdown, GlDropdownItem, GlDatepicker, GlSprintf, GlLink } from '@gitlab/ui'; import { GlDropdown, GlDropdownItem, GlDatepicker, GlSprintf, GlLink, GlModal } from '@gitlab/ui';
import { stubComponent } from 'helpers/stub_component';
import Api from '~/api'; import Api from '~/api';
import InviteMembersModal from '~/invite_members/components/invite_members_modal.vue'; import InviteMembersModal from '~/invite_members/components/invite_members_modal.vue';
...@@ -24,9 +25,12 @@ const createComponent = (data = {}) => { ...@@ -24,9 +25,12 @@ const createComponent = (data = {}) => {
return data; return data;
}, },
stubs: { stubs: {
'gl-modal': '<div><slot name="modal-footer"></slot><slot></slot></div>', GlModal: stubComponent(GlModal, {
'gl-dropdown': true, template:
'gl-dropdown-item': true, '<div><slot name="modal-title"></slot><slot></slot><slot name="modal-footer"></slot></div>',
}),
GlDropdown: true,
GlDropdownItem: true,
GlSprintf, GlSprintf,
}, },
}); });
......
...@@ -24,7 +24,6 @@ describe('Package Files', () => { ...@@ -24,7 +24,6 @@ describe('Package Files', () => {
stubs: { stubs: {
...stubChildren(component), ...stubChildren(component),
GlTable: false, GlTable: false,
GlLink: '<div><slot></slot></div>',
}, },
}); });
}; };
......
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