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
Jérome Perrin
gitlab-ce
Commits
ae62fc05
Commit
ae62fc05
authored
Apr 06, 2017
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes failing spec
parent
0dd3ce62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
app/assets/javascripts/merge_request_tabs.js
app/assets/javascripts/merge_request_tabs.js
+2
-0
spec/javascripts/merge_request_tabs_spec.js
spec/javascripts/merge_request_tabs_spec.js
+14
-1
No files found.
app/assets/javascripts/merge_request_tabs.js
View file @
ae62fc05
...
...
@@ -90,6 +90,7 @@ import './flash';
.
on
(
'
click
'
,
this
.
clickTab
);
}
// Used in tests
unbindEvents
()
{
$
(
document
)
.
off
(
'
shown.bs.tab
'
,
'
.merge-request-tabs a[data-toggle="tab"]
'
,
this
.
tabShown
)
...
...
@@ -103,6 +104,7 @@ import './flash';
if
(
this
.
commitPipelinesTable
)
{
document
.
querySelector
(
'
#commit-pipeline-table-view
'
)
.
removeChild
(
this
.
commitPipelinesTable
.
$el
);
this
.
commitPipelinesTable
.
$destroy
();
}
}
...
...
spec/javascripts/merge_request_tabs_spec.js
View file @
ae62fc05
...
...
@@ -39,7 +39,8 @@ require('vendor/jquery.scrollTo');
});
afterEach
(
function
()
{
this
.
class
.
destroy
();
this
.
class
.
unbindEvents
();
this
.
class
.
destroyPipelinesView
();
});
describe
(
'
#activateTab
'
,
function
()
{
...
...
@@ -65,6 +66,7 @@ require('vendor/jquery.scrollTo');
expect
(
$
(
'
#diffs
'
)).
toHaveClass
(
'
active
'
);
});
});
describe
(
'
#opensInNewTab
'
,
function
()
{
var
tabUrl
;
var
windowTarget
=
'
_blank
'
;
...
...
@@ -116,6 +118,7 @@ require('vendor/jquery.scrollTo');
stopImmediatePropagation
:
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
);
...
...
@@ -129,6 +132,7 @@ require('vendor/jquery.scrollTo');
stopImmediatePropagation
:
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
);
...
...
@@ -149,6 +153,7 @@ require('vendor/jquery.scrollTo');
spyOn
(
$
,
'
ajax
'
).
and
.
callFake
(
function
()
{});
this
.
subject
=
this
.
class
.
setCurrentAction
;
});
it
(
'
changes from commits
'
,
function
()
{
setLocation
({
pathname
:
'
/foo/bar/merge_requests/1/commits
'
...
...
@@ -156,13 +161,16 @@ require('vendor/jquery.scrollTo');
expect
(
this
.
subject
(
'
notes
'
)).
toBe
(
'
/foo/bar/merge_requests/1
'
);
expect
(
this
.
subject
(
'
diffs
'
)).
toBe
(
'
/foo/bar/merge_requests/1/diffs
'
);
});
it
(
'
changes from diffs
'
,
function
()
{
setLocation
({
pathname
:
'
/foo/bar/merge_requests/1/diffs
'
});
expect
(
this
.
subject
(
'
notes
'
)).
toBe
(
'
/foo/bar/merge_requests/1
'
);
expect
(
this
.
subject
(
'
commits
'
)).
toBe
(
'
/foo/bar/merge_requests/1/commits
'
);
});
it
(
'
changes from diffs.html
'
,
function
()
{
setLocation
({
pathname
:
'
/foo/bar/merge_requests/1/diffs.html
'
...
...
@@ -170,6 +178,7 @@ require('vendor/jquery.scrollTo');
expect
(
this
.
subject
(
'
notes
'
)).
toBe
(
'
/foo/bar/merge_requests/1
'
);
expect
(
this
.
subject
(
'
commits
'
)).
toBe
(
'
/foo/bar/merge_requests/1/commits
'
);
});
it
(
'
changes from notes
'
,
function
()
{
setLocation
({
pathname
:
'
/foo/bar/merge_requests/1
'
...
...
@@ -177,6 +186,7 @@ require('vendor/jquery.scrollTo');
expect
(
this
.
subject
(
'
diffs
'
)).
toBe
(
'
/foo/bar/merge_requests/1/diffs
'
);
expect
(
this
.
subject
(
'
commits
'
)).
toBe
(
'
/foo/bar/merge_requests/1/commits
'
);
});
it
(
'
includes search parameters and hash string
'
,
function
()
{
setLocation
({
pathname
:
'
/foo/bar/merge_requests/1/diffs
'
,
...
...
@@ -185,6 +195,7 @@ require('vendor/jquery.scrollTo');
});
expect
(
this
.
subject
(
'
show
'
)).
toBe
(
'
/foo/bar/merge_requests/1?view=parallel#L15-35
'
);
});
it
(
'
replaces the current history state
'
,
function
()
{
var
newState
;
setLocation
({
...
...
@@ -197,6 +208,7 @@ require('vendor/jquery.scrollTo');
},
document
.
title
,
newState
);
}
});
it
(
'
treats "show" like "notes"
'
,
function
()
{
setLocation
({
pathname
:
'
/foo/bar/merge_requests/1/commits
'
...
...
@@ -207,6 +219,7 @@ require('vendor/jquery.scrollTo');
describe
(
'
#tabShown
'
,
()
=>
{
beforeEach
(
function
()
{
spyOn
(
$
,
'
ajax
'
).
and
.
callFake
(
function
()
{});
loadFixtures
(
'
merge_requests/merge_request_with_task_list.html.raw
'
);
});
...
...
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