Commit 049ef298 authored by Kushal Pandya's avatar Kushal Pandya

Update param name, add test for `e.which = 2`

parent ef99b5e8
......@@ -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 () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment