mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
Fix broken test
Summary: Fixes a test that was broken due to my unfamiliarity with CoffeeScript :-/ Test Plan: Tests Reviewers: bengotow Reviewed By: bengotow Subscribers: juan Differential Revision: https://phab.nylas.com/D3302
This commit is contained in:
parent
6051512276
commit
dde4738363
1 changed files with 18 additions and 18 deletions
|
@ -106,26 +106,26 @@ describe "NylasSyncWorker", ->
|
|||
spyOn(Math, 'random').andReturn(1.0)
|
||||
@worker.start()
|
||||
|
||||
expectThings = (resumeCallCount) ->
|
||||
expectThings = (resumeCallCount, randomCallCount) =>
|
||||
expect(@worker.resume.callCount).toBe(resumeCallCount)
|
||||
expect(Math.random.callCount).toBe(resumeCallCount)
|
||||
expect(Math.random.callCount).toBe(randomCallCount)
|
||||
|
||||
expect(@worker.resume.callCount).toBe(1)
|
||||
simulateNetworkFailure(); expectThings(1)
|
||||
advanceClock(4000); expectThings(2)
|
||||
simulateNetworkFailure(); expectThings(2)
|
||||
advanceClock(4000); expectThings(2)
|
||||
advanceClock(4000); expectThings(3)
|
||||
simulateNetworkFailure(); expectThings(3)
|
||||
advanceClock(4000); expectThings(3)
|
||||
advanceClock(4000); expectThings(3)
|
||||
advanceClock(4000); expectThings(4)
|
||||
simulateNetworkFailure(); expectThings(4)
|
||||
advanceClock(4000); expectThings(4)
|
||||
advanceClock(4000); expectThings(4)
|
||||
advanceClock(4000); expectThings(4)
|
||||
advanceClock(4000); expectThings(4)
|
||||
advanceClock(4000); expectThings(5)
|
||||
expect(@worker.resume.callCount).toBe(1, 1)
|
||||
simulateNetworkFailure(); expectThings(1, 1)
|
||||
advanceClock(4000); expectThings(2, 1)
|
||||
simulateNetworkFailure(); expectThings(2, 2)
|
||||
advanceClock(4000); expectThings(2, 2)
|
||||
advanceClock(4000); expectThings(3, 2)
|
||||
simulateNetworkFailure(); expectThings(3, 3)
|
||||
advanceClock(4000); expectThings(3, 3)
|
||||
advanceClock(4000); expectThings(3, 3)
|
||||
advanceClock(4000); expectThings(4, 3)
|
||||
simulateNetworkFailure(); expectThings(4, 4)
|
||||
advanceClock(4000); expectThings(4, 4)
|
||||
advanceClock(4000); expectThings(4, 4)
|
||||
advanceClock(4000); expectThings(4, 4)
|
||||
advanceClock(4000); expectThings(4, 4)
|
||||
advanceClock(4000); expectThings(5, 4)
|
||||
|
||||
it "handles the request as a failure if we try and grab labels or folders without an 'inbox'", ->
|
||||
spyOn(@worker, 'resume').andCallThrough()
|
||||
|
|
Loading…
Reference in a new issue