diff options
author | Kushal Pandya <kushal@gitlab.com> | 2017-02-07 19:45:27 +0300 |
---|---|---|
committer | Kushal Pandya <kushal@gitlab.com> | 2017-02-07 19:45:27 +0300 |
commit | 1278b5cea4b05eb434649915a9d575c7ec3c95a2 (patch) | |
tree | 186164a60c856940eff049a222f4715d5125289e /spec | |
parent | 3633e04fcdc65ad8d15f47972c920c29d376362f (diff) |
ESLint: remove `expect()` from `beforeEach()`
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/merge_request_tabs_spec.js | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/spec/javascripts/merge_request_tabs_spec.js b/spec/javascripts/merge_request_tabs_spec.js index 72a05ce882c..92a0f1c05f7 100644 --- a/spec/javascripts/merge_request_tabs_spec.js +++ b/spec/javascripts/merge_request_tabs_spec.js @@ -62,17 +62,21 @@ require('vendor/jquery.scrollTo'); }); }); describe('#opensInNewTab', function () { + var commitsLink; + var tabUrl; + beforeEach(function () { - const commitsLink = '.commits-tab li a'; - const tabUrl = $(commitsLink).attr('href'); + commitsLink = '.commits-tab li a'; + tabUrl = $(commitsLink).attr('href'); spyOn($.fn, 'attr').and.returnValue(tabUrl); + }); + it('opens page tab in a new browser tab with Ctrl+Click - Windows/Linux', function () { spyOn(window, 'open').and.callFake(function (url, name) { expect(url).toEqual(tabUrl); expect(name).toEqual('_blank'); }); - }); - it('opens page tab in a new browser tab with Ctrl+Click - Windows/Linux', function () { + this.class.clickTab({ metaKey: false, ctrlKey: true, @@ -81,6 +85,11 @@ require('vendor/jquery.scrollTo'); }); }); it('opens page tab in a new browser tab with Cmd+Click - Mac', function () { + spyOn(window, 'open').and.callFake(function (url, name) { + expect(url).toEqual(tabUrl); + expect(name).toEqual('_blank'); + }); + this.class.clickTab({ metaKey: true, ctrlKey: false, @@ -89,6 +98,11 @@ require('vendor/jquery.scrollTo'); }); }); it('opens page tab in a new browser tab with Middle-click - Mac/PC', function () { + spyOn(window, 'open').and.callFake(function (url, name) { + expect(url).toEqual(tabUrl); + expect(name).toEqual('_blank'); + }); + this.class.clickTab({ metaKey: false, ctrlKey: false, |