Commit 75816023 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch 'rename-lock_issue_sidebar' into 'master'

Rename lock issue sidebar and update its spec to remove mediator

See merge request gitlab-org/gitlab!38076
parents b58151bb b4770826
...@@ -5,7 +5,7 @@ import SidebarTimeTracking from './components/time_tracking/sidebar_time_trackin ...@@ -5,7 +5,7 @@ import SidebarTimeTracking from './components/time_tracking/sidebar_time_trackin
import SidebarAssignees from './components/assignees/sidebar_assignees.vue'; import SidebarAssignees from './components/assignees/sidebar_assignees.vue';
import ConfidentialIssueSidebar from './components/confidential/confidential_issue_sidebar.vue'; import ConfidentialIssueSidebar from './components/confidential/confidential_issue_sidebar.vue';
import SidebarMoveIssue from './lib/sidebar_move_issue'; import SidebarMoveIssue from './lib/sidebar_move_issue';
import LockIssueSidebar from './components/lock/lock_issue_sidebar.vue'; import IssuableLockForm from './components/lock/issuable_lock_form.vue';
import sidebarParticipants from './components/participants/sidebar_participants.vue'; import sidebarParticipants from './components/participants/sidebar_participants.vue';
import sidebarSubscriptions from './components/subscriptions/sidebar_subscriptions.vue'; import sidebarSubscriptions from './components/subscriptions/sidebar_subscriptions.vue';
import Translate from '../vue_shared/translate'; import Translate from '../vue_shared/translate';
...@@ -95,7 +95,7 @@ function mountLockComponent() { ...@@ -95,7 +95,7 @@ function mountLockComponent() {
fullPath, fullPath,
}, },
render: createElement => render: createElement =>
createElement(LockIssueSidebar, { createElement(IssuableLockForm, {
props: { props: {
isEditable: initialData.is_editable, isEditable: initialData.is_editable,
}, },
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { mockTracking, triggerEvent } from 'helpers/tracking_helper'; import { mockTracking, triggerEvent } from 'helpers/tracking_helper';
import LockIssueSidebar from '~/sidebar/components/lock/lock_issue_sidebar.vue'; import IssuableLockForm from '~/sidebar/components/lock/issuable_lock_form.vue';
import EditForm from '~/sidebar/components/lock/edit_form.vue'; import EditForm from '~/sidebar/components/lock/edit_form.vue';
import createStore from '~/notes/stores'; import createStore from '~/notes/stores';
import { createStore as createMrStore } from '~/mr_notes/stores'; import { createStore as createMrStore } from '~/mr_notes/stores';
import { ISSUABLE_TYPE_ISSUE, ISSUABLE_TYPE_MR } from './constants'; import { ISSUABLE_TYPE_ISSUE, ISSUABLE_TYPE_MR } from './constants';
describe('LockIssueSidebar', () => { describe('IssuableLockForm', () => {
let wrapper; let wrapper;
let store; let store;
let mediator;
let issuableType; // Either ISSUABLE_TYPE_ISSUE or ISSUABLE_TYPE_MR let issuableType; // Either ISSUABLE_TYPE_ISSUE or ISSUABLE_TYPE_MR
const setIssuableType = pageType => { const setIssuableType = pageType => {
...@@ -21,15 +20,6 @@ describe('LockIssueSidebar', () => { ...@@ -21,15 +20,6 @@ describe('LockIssueSidebar', () => {
const findEditLink = () => wrapper.find('[data-testid="edit-link"]'); const findEditLink = () => wrapper.find('[data-testid="edit-link"]');
const findEditForm = () => wrapper.find(EditForm); const findEditForm = () => wrapper.find(EditForm);
const initMediator = () => {
mediator = {
service: {
update: Promise.resolve(true),
},
store: {},
};
};
const initStore = isLocked => { const initStore = isLocked => {
if (issuableType === ISSUABLE_TYPE_ISSUE) { if (issuableType === ISSUABLE_TYPE_ISSUE) {
store = createStore(); store = createStore();
...@@ -41,11 +31,10 @@ describe('LockIssueSidebar', () => { ...@@ -41,11 +31,10 @@ describe('LockIssueSidebar', () => {
}; };
const createComponent = ({ props = {} }) => { const createComponent = ({ props = {} }) => {
wrapper = shallowMount(LockIssueSidebar, { wrapper = shallowMount(IssuableLockForm, {
store, store,
propsData: { propsData: {
isEditable: true, isEditable: true,
mediator,
...props, ...props,
}, },
}); });
...@@ -62,7 +51,6 @@ describe('LockIssueSidebar', () => { ...@@ -62,7 +51,6 @@ describe('LockIssueSidebar', () => {
`('In $pageType page', ({ pageType }) => { `('In $pageType page', ({ pageType }) => {
beforeEach(() => { beforeEach(() => {
setIssuableType(pageType); setIssuableType(pageType);
initMediator();
}); });
describe.each` describe.each`
......
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