diff options
author | Kushal Pandya <kushal@gitlab.com> | 2017-02-07 09:04:42 +0300 |
---|---|---|
committer | Kushal Pandya <kushal@gitlab.com> | 2017-02-07 18:42:01 +0300 |
commit | 049ef298e9ad3e3054446870326369f40f2ab164 (patch) | |
tree | 6aa4140db6efb3b66fee032e61d4feaa77220f43 /spec/javascripts | |
parent | ef99b5e8969c939fce576a6d25c6b8dd4ce54f5f (diff) |
Update param name, add test for `e.which = 2`
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/merge_request_tabs_spec.js | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/spec/javascripts/merge_request_tabs_spec.js b/spec/javascripts/merge_request_tabs_spec.js index 1a0fcd4e33e..07f9797c229 100644 --- a/spec/javascripts/merge_request_tabs_spec.js +++ b/spec/javascripts/merge_request_tabs_spec.js @@ -84,9 +84,9 @@ require('vendor/jquery.scrollTo'); const tabUrl = $(commitsLink).attr('href'); spyOn($.fn, 'attr').and.returnValue(tabUrl); - spyOn(window, 'open').and.callFake(function (url, name) { + spyOn(window, 'open').and.callFake(function (url, target) { expect(url).toEqual(tabUrl); - expect(name).toEqual('_blank'); + expect(target).toEqual('_blank'); }); this.class.clickTab({ @@ -96,6 +96,23 @@ require('vendor/jquery.scrollTo'); stopImmediatePropagation: function () {} }); }); + it('opens page tab in a new browser tab with Middle-click - Mac/PC', function () { + const commitsLink = '.commits-tab li a'; + const tabUrl = $(commitsLink).attr('href'); + + spyOn($.fn, 'attr').and.returnValue(tabUrl); + spyOn(window, 'open').and.callFake(function (url, target) { + expect(url).toEqual(tabUrl); + expect(target).toEqual('_blank'); + }); + + this.class.clickTab({ + metaKey: false, + ctrlKey: false, + which: 2, + stopImmediatePropagation: function () {} + }); + }); }); describe('#setCurrentAction', function () { |