diff options
Diffstat (limited to 'spec/javascripts/issue_show/components/description_spec.js')
-rw-r--r-- | spec/javascripts/issue_show/components/description_spec.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/javascripts/issue_show/components/description_spec.js b/spec/javascripts/issue_show/components/description_spec.js index 52148f4c66b..b6833079e6e 100644 --- a/spec/javascripts/issue_show/components/description_spec.js +++ b/spec/javascripts/issue_show/components/description_spec.js @@ -187,4 +187,18 @@ describe('Description component', () => { it('sets data-update-url', () => { expect(vm.$el.querySelector('textarea').dataset.updateUrl).toEqual(gl.TEST_HOST); }); + + describe('taskListUpdateError', () => { + it('should create flash notification and emit an event to parent', () => { + const msg = + 'Someone edited this issue at the same time you did and we updated the issue description.'; + spyOn(window, 'Flash'); + spyOn(vm, '$emit'); + + vm.taskListUpdateError(); + + expect(window.Flash).toHaveBeenCalledWith(msg); + expect(vm.$emit).toHaveBeenCalledWith('taskListUpdateFailed'); + }); + }); }); |