Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
3633e04f
Commit
3633e04f
authored
Feb 07, 2017
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor tests for `#opensInNewTab`
parent
a11b2304
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
20 deletions
+3
-20
spec/javascripts/merge_request_tabs_spec.js
spec/javascripts/merge_request_tabs_spec.js
+3
-20
No files found.
spec/javascripts/merge_request_tabs_spec.js
View file @
3633e04f
...
...
@@ -62,7 +62,7 @@ require('vendor/jquery.scrollTo');
});
});
describe
(
'
#opensInNewTab
'
,
function
()
{
it
(
'
opens page tab in a new browser tab with Ctrl+Click - Windows/Linux
'
,
function
()
{
beforeEach
(
function
()
{
const
commitsLink
=
'
.commits-tab li a
'
;
const
tabUrl
=
$
(
commitsLink
).
attr
(
'
href
'
);
...
...
@@ -71,7 +71,8 @@ require('vendor/jquery.scrollTo');
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
,
...
...
@@ -80,15 +81,6 @@ require('vendor/jquery.scrollTo');
});
});
it
(
'
opens page tab in a new browser tab with Cmd+Click - Mac
'
,
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
:
true
,
ctrlKey
:
false
,
...
...
@@ -97,15 +89,6 @@ require('vendor/jquery.scrollTo');
});
});
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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment