2017-08-07 23:56:16 +00:00
|
|
|
import Vue from 'vue';
|
|
|
|
import editForm from '~/sidebar/components/confidential/edit_form.vue';
|
|
|
|
|
|
|
|
describe('Edit Form Dropdown', () => {
|
|
|
|
let vm1;
|
|
|
|
let vm2;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
const Component = Vue.extend(editForm);
|
2018-10-17 07:13:26 +00:00
|
|
|
const toggleForm = () => {};
|
|
|
|
const updateConfidentialAttribute = () => {};
|
2017-08-07 23:56:16 +00:00
|
|
|
|
|
|
|
vm1 = new Component({
|
|
|
|
propsData: {
|
|
|
|
isConfidential: true,
|
|
|
|
toggleForm,
|
|
|
|
updateConfidentialAttribute,
|
|
|
|
},
|
|
|
|
}).$mount();
|
|
|
|
|
|
|
|
vm2 = new Component({
|
|
|
|
propsData: {
|
|
|
|
isConfidential: false,
|
|
|
|
toggleForm,
|
|
|
|
updateConfidentialAttribute,
|
|
|
|
},
|
|
|
|
}).$mount();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders on the appropriate warning text', () => {
|
2018-10-17 07:13:26 +00:00
|
|
|
expect(vm1.$el.innerHTML.includes('You are going to turn off the confidentiality.')).toBe(true);
|
2017-08-07 23:56:16 +00:00
|
|
|
|
2018-10-17 07:13:26 +00:00
|
|
|
expect(vm2.$el.innerHTML.includes('You are going to turn on the confidentiality.')).toBe(true);
|
2017-08-07 23:56:16 +00:00
|
|
|
});
|
|
|
|
});
|