diff options
author | Regis Boudinot <boudinot.regis@yahoo.com> | 2017-08-08 02:56:16 +0300 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2017-08-08 02:56:16 +0300 |
commit | f59bdbf0f12b2f370a6931753d8ee14ba92d66ea (patch) | |
tree | 24da1adbf5c2c4a5ee0e6d22b96b3255a7159641 /spec/javascripts/sidebar/confidential_edit_buttons_spec.js | |
parent | 1bed998ee91231bafab74a5b423d9ef1d966989d (diff) |
33874 confidential issue redesign
Diffstat (limited to 'spec/javascripts/sidebar/confidential_edit_buttons_spec.js')
-rw-r--r-- | spec/javascripts/sidebar/confidential_edit_buttons_spec.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/javascripts/sidebar/confidential_edit_buttons_spec.js b/spec/javascripts/sidebar/confidential_edit_buttons_spec.js new file mode 100644 index 00000000000..482be466aad --- /dev/null +++ b/spec/javascripts/sidebar/confidential_edit_buttons_spec.js @@ -0,0 +1,39 @@ +import Vue from 'vue'; +import editFormButtons from '~/sidebar/components/confidential/edit_form_buttons.vue'; + +describe('Edit Form Buttons', () => { + let vm1; + let vm2; + + beforeEach(() => { + const Component = Vue.extend(editFormButtons); + const toggleForm = () => { }; + const updateConfidentialAttribute = () => { }; + + vm1 = new Component({ + propsData: { + isConfidential: true, + toggleForm, + updateConfidentialAttribute, + }, + }).$mount(); + + vm2 = new Component({ + propsData: { + isConfidential: false, + toggleForm, + updateConfidentialAttribute, + }, + }).$mount(); + }); + + it('renders on or off text based on confidentiality', () => { + expect( + vm1.$el.innerHTML.includes('Turn Off'), + ).toBe(true); + + expect( + vm2.$el.innerHTML.includes('Turn On'), + ).toBe(true); + }); +}); |