fix(spec): fix nylas api specs

This commit is contained in:
Evan Morikawa 2016-03-09 10:03:05 -05:00
parent 21059fed3c
commit 6cb2791642

View file

@ -51,14 +51,14 @@ describe "NylasAPI", ->
spyOn(Actions, 'postNotification')
NylasAPI._handleAuthenticationFailure('/threads/1234', 'token')
expect(Actions.postNotification).toHaveBeenCalled()
expect(Actions.postNotification.mostRecentCall.args[0].message.trim()).toEqual("Nylas N1 can no longer authenticate with your mail provider. You will not be able to send or receive mail. Please click here to reconnect your account.")
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.")
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("Nylas N1 can no longer authenticate with #{AccountStore.accounts()[0].emailAddress}. You will not be able to send or receive mail. Please click here to reconnect your account.")
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.")
describe "handleModelResponse", ->
beforeEach ->