BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
408b56bd
Commit
408b56bd
authored
Dec 19, 2017
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix racing condition in Ajax call of merge_request_tabs_spec.js
parent
e0a27ee4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
merge_request_tabs_spec.js
spec/javascripts/merge_request_tabs_spec.js
+9
-5
No files found.
spec/javascripts/merge_request_tabs_spec.js
View file @
408b56bd
...
...
@@ -290,15 +290,18 @@ import 'vendor/jquery.scrollTo';
$
(
'body'
).
removeAttr
(
'data-page'
);
});
it
(
'requires an absolute pathname'
,
function
()
{
spyOn
(
$
,
'ajax'
).
and
.
callFake
(
function
(
options
)
{
expect
(
options
.
url
).
toEqual
(
'/foo/bar/merge_requests/1/diffs.json'
);
it
(
'triggers Ajax request to JSON endpoint'
,
function
(
done
)
{
const
url
=
'/foo/bar/merge_requests/1/diffs'
;
spyOn
(
this
.
class
,
'ajaxGet'
).
and
.
callFake
((
options
)
=>
{
expect
(
options
.
url
).
toEqual
(
`
${
url
}
.json`
);
done
();
});
this
.
class
.
loadDiff
(
'/foo/bar/merge_requests/1/diffs'
);
this
.
class
.
loadDiff
(
url
);
});
it
(
'triggers scroll event when diff already loaded'
,
function
()
{
it
(
'triggers scroll event when diff already loaded'
,
function
(
done
)
{
spyOn
(
this
.
class
,
'ajaxGet'
).
and
.
callFake
(()
=>
done
.
fail
());
spyOn
(
document
,
'dispatchEvent'
);
this
.
class
.
diffsLoaded
=
true
;
...
...
@@ -307,6 +310,7 @@ import 'vendor/jquery.scrollTo';
expect
(
document
.
dispatchEvent
,
).
toHaveBeenCalledWith
(
new
CustomEvent
(
'scroll'
));
done
();
});
describe
(
'with inline diff'
,
()
=>
{
...
...
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