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
import SidebarAssignees from './components/assignees/sidebar_assignees.vue';
import ConfidentialIssueSidebar from './components/confidential/confidential_issue_sidebar.vue';
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 sidebarSubscriptions from './components/subscriptions/sidebar_subscriptions.vue';
import Translate from '../vue_shared/translate';
......@@ -95,7 +95,7 @@ function mountLockComponent() {
fullPath,
},
render: createElement =>
createElement(LockIssueSidebar, {
createElement(IssuableLockForm, {
props: {
isEditable: initialData.is_editable,
},
......
import { shallowMount } from '@vue/test-utils';
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 createStore from '~/notes/stores';
import { createStore as createMrStore } from '~/mr_notes/stores';
import { ISSUABLE_TYPE_ISSUE, ISSUABLE_TYPE_MR } from './constants';
describe('LockIssueSidebar', () => {
describe('IssuableLockForm', () => {
let wrapper;
let store;
let mediator;
let issuableType; // Either ISSUABLE_TYPE_ISSUE or ISSUABLE_TYPE_MR
const setIssuableType = pageType => {
......@@ -21,15 +20,6 @@ describe('LockIssueSidebar', () => {
const findEditLink = () => wrapper.find('[data-testid="edit-link"]');
const findEditForm = () => wrapper.find(EditForm);
const initMediator = () => {
mediator = {
service: {
update: Promise.resolve(true),
},
store: {},
};
};
const initStore = isLocked => {
if (issuableType === ISSUABLE_TYPE_ISSUE) {
store = createStore();
......@@ -41,11 +31,10 @@ describe('LockIssueSidebar', () => {
};
const createComponent = ({ props = {} }) => {
wrapper = shallowMount(LockIssueSidebar, {
wrapper = shallowMount(IssuableLockForm, {
store,
propsData: {
isEditable: true,
mediator,
...props,
},
});
......@@ -62,7 +51,6 @@ describe('LockIssueSidebar', () => {
`('In $pageType page', ({ pageType }) => {
beforeEach(() => {
setIssuableType(pageType);
initMediator();
});
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