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
Léo-Paul Géneau
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
spec/javascripts/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