diff options
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 () { |