diff options
author | Phil Hughes <me@iamphill.com> | 2017-05-12 11:58:48 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-05-15 11:33:31 +0100 |
commit | 3bd37bc4a0d6b8ab6ebaabc2ee1c130201b20a21 (patch) | |
tree | 6a52c734aea370000d887cb763a39eeae6e0db48 /spec/javascripts/issue_show/components/app_spec.js | |
parent | 86700b97d3a357b572e6eb92759a64d594aa06c5 (diff) | |
download | gitlab-ce-3bd37bc4a0d6b8ab6ebaabc2ee1c130201b20a21.tar.gz |
Shows delete button if permissions are correct
[ci skip]
Diffstat (limited to 'spec/javascripts/issue_show/components/app_spec.js')
-rw-r--r-- | spec/javascripts/issue_show/components/app_spec.js | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/spec/javascripts/issue_show/components/app_spec.js b/spec/javascripts/issue_show/components/app_spec.js index 9c066a5908b..0af4d1e1f6a 100644 --- a/spec/javascripts/issue_show/components/app_spec.js +++ b/spec/javascripts/issue_show/components/app_spec.js @@ -28,12 +28,13 @@ describe('Issuable output', () => { vm = new IssuableDescriptionComponent({ propsData: { canUpdate: true, + canDestroy: true, endpoint: '/gitlab-org/gitlab-shell/issues/9/rendered_title', issuableRef: '#1', initialTitle: '', initialDescriptionHtml: '', initialDescriptionText: '', - showForm: true, + showForm: false, }, }).$mount(); }); @@ -62,6 +63,31 @@ describe('Issuable output', () => { }); }); + it('shows actions if permissions are correct', (done) => { + vm.showForm = true; + + Vue.nextTick(() => { + expect( + vm.$el.querySelector('.btn'), + ).not.toBeNull(); + + done(); + }); + }); + + it('does not show actions if permissions are incorrect', (done) => { + vm.showForm = true; + vm.canUpdate = false; + + Vue.nextTick(() => { + expect( + vm.$el.querySelector('.btn'), + ).toBeNull(); + + done(); + }); + }); + describe('updateIssuable', () => { it('correctly updates issuable data', (done) => { spyOn(vm.service, 'updateIssuable').and.callFake(() => new Promise((resolve) => { |