diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-08-07 14:51:46 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-08-07 14:51:46 +0300 |
commit | 126d47754cf3639ab80ae29d116b93129da2940e (patch) | |
tree | a8fca3cba5f53bce8952dc79185a8e836e950909 | |
parent | 3f15afbe3f48d80d44f16dbec5e6bbc8dff91741 (diff) |
Cover repo_tab xClicked
-rw-r--r-- | spec/javascripts/repo/components/repo_tab_spec.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/javascripts/repo/components/repo_tab_spec.js b/spec/javascripts/repo/components/repo_tab_spec.js index 0ce11b36bd3..a79128e6b2d 100644 --- a/spec/javascripts/repo/components/repo_tab_spec.js +++ b/spec/javascripts/repo/components/repo_tab_spec.js @@ -64,4 +64,25 @@ describe('RepoTab', () => { expect(vm.$el.querySelector('.close .fa-circle')).toBeTruthy(); }); + + fdescribe('methods', () => { + describe('xClicked', () => { + const vm = jasmine.createSpyObj('vm', ['$emit']); + + it('returns undefined and does not $emit if file is changed', () => { + const file = { changed: true }; + const returnVal = repoTab.methods.xClicked.call(vm, file); + + expect(returnVal).toBeUndefined(); + expect(vm.$emit).not.toHaveBeenCalled(); + }); + + it('$emits xclicked event with file obj', () => { + const file = { changed: false }; + repoTab.methods.xClicked.call(vm, file); + + expect(vm.$emit).toHaveBeenCalledWith('xclicked', file); + }); + }); + }); }); |