diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-08-07 14:55:02 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-08-07 14:55:02 +0300 |
commit | 62e3b28c56b62e4c459758a399dfdf69edb5a7ac (patch) | |
tree | a3aa85cd18050acaf47fce7b9c73d1c035e162bc | |
parent | 126d47754cf3639ab80ae29d116b93129da2940e (diff) |
Cover repo_tabs xClicked method
-rw-r--r-- | spec/javascripts/repo/components/repo_tab_spec.js | 2 | ||||
-rw-r--r-- | spec/javascripts/repo/components/repo_tabs_spec.js | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/spec/javascripts/repo/components/repo_tab_spec.js b/spec/javascripts/repo/components/repo_tab_spec.js index a79128e6b2d..f3572804b4a 100644 --- a/spec/javascripts/repo/components/repo_tab_spec.js +++ b/spec/javascripts/repo/components/repo_tab_spec.js @@ -65,7 +65,7 @@ describe('RepoTab', () => { expect(vm.$el.querySelector('.close .fa-circle')).toBeTruthy(); }); - fdescribe('methods', () => { + describe('methods', () => { describe('xClicked', () => { const vm = jasmine.createSpyObj('vm', ['$emit']); diff --git a/spec/javascripts/repo/components/repo_tabs_spec.js b/spec/javascripts/repo/components/repo_tabs_spec.js index 036bc4672c0..2c7e71b7af8 100644 --- a/spec/javascripts/repo/components/repo_tabs_spec.js +++ b/spec/javascripts/repo/components/repo_tabs_spec.js @@ -47,4 +47,18 @@ describe('RepoTabs', () => { expect(vm.$el.classList.contains('overflown')).toBeFalsy(); }); + + fdescribe('methods', () => { + describe('xClicked', () => { + it('calls removeFromOpenedFiles with file obj', () => { + const file = {}; + + spyOn(RepoStore, 'removeFromOpenedFiles'); + + repoTabs.methods.xClicked(file); + + expect(RepoStore.removeFromOpenedFiles).toHaveBeenCalledWith(file); + }); + }); + }); }); |