diff options
Diffstat (limited to 'spec/javascripts/lib/utils/poll_spec.js')
-rw-r--r-- | spec/javascripts/lib/utils/poll_spec.js | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/spec/javascripts/lib/utils/poll_spec.js b/spec/javascripts/lib/utils/poll_spec.js index b28a052902e..d0da659c3d7 100644 --- a/spec/javascripts/lib/utils/poll_spec.js +++ b/spec/javascripts/lib/utils/poll_spec.js @@ -47,7 +47,7 @@ describe('Poll', () => { service.fetch.calls.reset(); }); - it('calls the success callback when no header for interval is provided', (done) => { + it('calls the success callback when no header for interval is provided', done => { mockServiceCall(service, { status: 200 }); setup(); @@ -59,7 +59,7 @@ describe('Poll', () => { }); }); - it('calls the error callback when the http request returns an error', (done) => { + it('calls the error callback when the http request returns an error', done => { mockServiceCall(service, { status: 500 }, true); setup(); @@ -71,7 +71,7 @@ describe('Poll', () => { }); }); - it('skips the error callback when request is aborted', (done) => { + it('skips the error callback when request is aborted', done => { mockServiceCall(service, { status: 0 }, true); setup(); @@ -84,19 +84,21 @@ describe('Poll', () => { }); }); - it('should call the success callback when the interval header is -1', (done) => { + it('should call the success callback when the interval header is -1', done => { mockServiceCall(service, { status: 200, headers: { 'poll-interval': -1 } }); - setup().then(() => { - expect(callbacks.success).toHaveBeenCalled(); - expect(callbacks.error).not.toHaveBeenCalled(); + setup() + .then(() => { + expect(callbacks.success).toHaveBeenCalled(); + expect(callbacks.error).not.toHaveBeenCalled(); - done(); - }).catch(done.fail); + done(); + }) + .catch(done.fail); }); describe('for 2xx status code', () => { successCodes.forEach(httpCode => { - it(`starts polling when http status is ${httpCode} and interval header is provided`, (done) => { + it(`starts polling when http status is ${httpCode} and interval header is provided`, done => { mockServiceCall(service, { status: httpCode, headers: { 'poll-interval': 1 } }); const Polling = new Poll({ @@ -124,7 +126,7 @@ describe('Poll', () => { }); describe('stop', () => { - it('stops polling when method is called', (done) => { + it('stops polling when method is called', done => { mockServiceCall(service, { status: 200, headers: { 'poll-interval': 1 } }); const Polling = new Poll({ @@ -152,7 +154,7 @@ describe('Poll', () => { }); describe('restart', () => { - it('should restart polling when its called', (done) => { + it('should restart polling when its called', done => { mockServiceCall(service, { status: 200, headers: { 'poll-interval': 1 } }); const Polling = new Poll({ |