2017-09-14 11:01:07 +00:00
|
|
|
import Vue from 'vue';
|
|
|
|
import editForm from '~/sidebar/components/lock/edit_form.vue';
|
|
|
|
|
|
|
|
describe('EditForm', () => {
|
|
|
|
let vm1;
|
|
|
|
let vm2;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
const Component = Vue.extend(editForm);
|
2018-10-17 07:13:26 +00:00
|
|
|
const toggleForm = () => {};
|
|
|
|
const updateLockedAttribute = () => {};
|
2017-09-14 11:01:07 +00:00
|
|
|
|
|
|
|
vm1 = new Component({
|
|
|
|
propsData: {
|
|
|
|
isLocked: true,
|
|
|
|
toggleForm,
|
|
|
|
updateLockedAttribute,
|
|
|
|
issuableType: 'issue',
|
|
|
|
},
|
|
|
|
}).$mount();
|
|
|
|
|
|
|
|
vm2 = new Component({
|
|
|
|
propsData: {
|
|
|
|
isLocked: false,
|
|
|
|
toggleForm,
|
|
|
|
updateLockedAttribute,
|
|
|
|
issuableType: 'merge_request',
|
|
|
|
},
|
|
|
|
}).$mount();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders on the appropriate warning text', () => {
|
2018-10-17 07:13:26 +00:00
|
|
|
expect(vm1.$el.innerHTML.includes('Unlock this issue?')).toBe(true);
|
2017-09-14 11:01:07 +00:00
|
|
|
|
2018-10-17 07:13:26 +00:00
|
|
|
expect(vm2.$el.innerHTML.includes('Lock this merge request?')).toBe(true);
|
2017-09-14 11:01:07 +00:00
|
|
|
});
|
|
|
|
});
|