Commit 1278b5ce authored by Kushal Pandya's avatar Kushal Pandya

ESLint: remove `expect()` from `beforeEach()`

parent 3633e04f
...@@ -62,17 +62,21 @@ require('vendor/jquery.scrollTo'); ...@@ -62,17 +62,21 @@ require('vendor/jquery.scrollTo');
}); });
}); });
describe('#opensInNewTab', function () { describe('#opensInNewTab', function () {
var commitsLink;
var tabUrl;
beforeEach(function () { beforeEach(function () {
const commitsLink = '.commits-tab li a'; commitsLink = '.commits-tab li a';
const tabUrl = $(commitsLink).attr('href'); tabUrl = $(commitsLink).attr('href');
spyOn($.fn, 'attr').and.returnValue(tabUrl); 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) { spyOn(window, 'open').and.callFake(function (url, name) {
expect(url).toEqual(tabUrl); expect(url).toEqual(tabUrl);
expect(name).toEqual('_blank'); expect(name).toEqual('_blank');
}); });
});
it('opens page tab in a new browser tab with Ctrl+Click - Windows/Linux', function () {
this.class.clickTab({ this.class.clickTab({
metaKey: false, metaKey: false,
ctrlKey: true, ctrlKey: true,
...@@ -81,6 +85,11 @@ require('vendor/jquery.scrollTo'); ...@@ -81,6 +85,11 @@ require('vendor/jquery.scrollTo');
}); });
}); });
it('opens page tab in a new browser tab with Cmd+Click - Mac', function () { 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({ this.class.clickTab({
metaKey: true, metaKey: true,
ctrlKey: false, ctrlKey: false,
...@@ -89,6 +98,11 @@ require('vendor/jquery.scrollTo'); ...@@ -89,6 +98,11 @@ require('vendor/jquery.scrollTo');
}); });
}); });
it('opens page tab in a new browser tab with Middle-click - Mac/PC', function () { 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({ this.class.clickTab({
metaKey: false, metaKey: false,
ctrlKey: false, ctrlKey: false,
......
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