fix(specs): *

This commit is contained in:
Ben Gotow 2016-04-08 16:03:21 -07:00
parent b10942a4b3
commit f316c06f7a
3 changed files with 14 additions and 11 deletions

View file

@ -102,17 +102,20 @@ describe "NylasSyncWorker", ->
expect(@worker.resume.callCount).toBe(1)
simulateNetworkFailure(); expect(@worker.resume.callCount).toBe(1)
advanceClock(30000); expect(@worker.resume.callCount).toBe(2)
advanceClock(4000); expect(@worker.resume.callCount).toBe(2)
simulateNetworkFailure(); expect(@worker.resume.callCount).toBe(2)
advanceClock(30000); expect(@worker.resume.callCount).toBe(2)
advanceClock(30000); expect(@worker.resume.callCount).toBe(3)
advanceClock(4000); expect(@worker.resume.callCount).toBe(2)
advanceClock(4000); expect(@worker.resume.callCount).toBe(3)
simulateNetworkFailure(); expect(@worker.resume.callCount).toBe(3)
advanceClock(30000); expect(@worker.resume.callCount).toBe(3)
advanceClock(30000); expect(@worker.resume.callCount).toBe(4)
advanceClock(4000); expect(@worker.resume.callCount).toBe(3)
advanceClock(4000); expect(@worker.resume.callCount).toBe(3)
advanceClock(4000); expect(@worker.resume.callCount).toBe(4)
simulateNetworkFailure(); expect(@worker.resume.callCount).toBe(4)
advanceClock(30000); expect(@worker.resume.callCount).toBe(4)
advanceClock(30000); expect(@worker.resume.callCount).toBe(4)
advanceClock(30000); expect(@worker.resume.callCount).toBe(5)
advanceClock(4000); expect(@worker.resume.callCount).toBe(4)
advanceClock(4000); expect(@worker.resume.callCount).toBe(4)
advanceClock(4000); expect(@worker.resume.callCount).toBe(4)
advanceClock(4000); expect(@worker.resume.callCount).toBe(4)
advanceClock(4000); expect(@worker.resume.callCount).toBe(5)
it "handles the request as a failure if we try and grab labels or folders without an 'inbox'", ->
spyOn(@worker, 'resume').andCallThrough()

View file

@ -156,14 +156,14 @@ describe "NylasAPI", ->
spyOn(Actions, 'postNotification')
NylasAPI._handleAuthenticationFailure('/threads/1234', 'token')
expect(Actions.postNotification).toHaveBeenCalled()
expect(Actions.postNotification.mostRecentCall.args[0].message.trim()).toEqual("Action failed: There was an error syncing with your mail provider. You may not be able to send or receive mail.")
expect(Actions.postNotification.mostRecentCall.args[0].message.trim()).toEqual("A mailbox action for your mail provider could not be completed. You may not be able to send or receive mail.")
it "should include the email address if possible", ->
spyOn(AccountStore, 'tokenForAccountId').andReturn('token')
spyOn(Actions, 'postNotification')
NylasAPI._handleAuthenticationFailure('/threads/1234', 'token')
expect(Actions.postNotification).toHaveBeenCalled()
expect(Actions.postNotification.mostRecentCall.args[0].message.trim()).toEqual("Action failed: There was an error syncing with #{AccountStore.accounts()[0].emailAddress}. You may not be able to send or receive mail.")
expect(Actions.postNotification.mostRecentCall.args[0].message.trim()).toEqual("A mailbox action for #{AccountStore.accounts()[0].emailAddress} could not be completed. You may not be able to send or receive mail.")
describe "handleModelResponse", ->
beforeEach ->

View file

@ -256,7 +256,7 @@ class NylasAPI
type: 'error'
tag: '401'
sticky: true
message: "An mailbox action for #{email} could not be completed. You
message: "A mailbox action for #{email} could not be completed. You
may not be able to send or receive mail.",
icon: 'fa-sign-out'
actions: [{