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
45b2c63f
Commit
45b2c63f
authored
Mar 22, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplifies assignment of default options
parent
269adbf9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
app/assets/javascripts/lib/utils/poll.js
app/assets/javascripts/lib/utils/poll.js
+2
-3
spec/javascripts/lib/utils/poll_spec.js
spec/javascripts/lib/utils/poll_spec.js
+2
-0
No files found.
app/assets/javascripts/lib/utils/poll.js
View file @
45b2c63f
...
...
@@ -32,9 +32,8 @@ import httpStatusCodes from './http_status';
*/
export
default
class
Poll
{
constructor
(
options
=
{})
{
this
.
options
=
Object
.
assign
({},
{
data
:
{},
},
options
);
this
.
options
=
options
;
this
.
options
.
data
=
options
.
data
||
{};
this
.
intervalHeader
=
'
POLL-INTERVAL
'
;
}
...
...
spec/javascripts/lib/utils/poll_spec.js
View file @
45b2c63f
...
...
@@ -109,12 +109,14 @@ describe('Poll', () => {
new
Poll
({
resource
:
service
,
method
:
'
fetch
'
,
data
:
{
page
:
1
},
successCallback
:
callbacks
.
success
,
errorCallback
:
callbacks
.
error
,
}).
makeRequest
();
setTimeout
(()
=>
{
expect
(
service
.
fetch
.
calls
.
count
()).
toEqual
(
2
);
expect
(
service
.
fetch
).
toHaveBeenCalledWith
({
page
:
1
});
expect
(
callbacks
.
success
).
toHaveBeenCalled
();
expect
(
callbacks
.
error
).
not
.
toHaveBeenCalled
();
done
();
...
...
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