fix(specs): Fix specs for account store token initialization

This commit is contained in:
Juan Tejada 2016-03-23 18:10:15 -07:00
parent e40f4c58fd
commit 2e860f97ec

View file

@ -61,7 +61,6 @@ describe "AccountStore", ->
expect(@instance.tokenForAccountId('A')).toEqual('A-TOKEN')
expect(@instance.tokenForAccountId('B')).toEqual(undefined)
expect(keytar.replacePassword).toHaveBeenCalledWith('Nylas', 'bengotow@gmail.com', 'A-TOKEN')
expect(NylasEnv.config.set).toHaveBeenCalledWith('nylas.accountTokens', null)
it "should initialize tokens from keytar", ->
@configTokens = null
@ -114,8 +113,9 @@ describe "AccountStore", ->
account = (new Account).fromJSON(@json)
expect(@instance._accounts.length).toBe 1
expect(@instance._accounts[0]).toEqual account
expect(NylasEnv.config.set.calls.length).toBe 3
expect(NylasEnv.config.set.calls[2].args).toEqual(['nylas.accountTokens', null])
expect(NylasEnv.config.save).toHaveBeenCalled()
expect(NylasEnv.config.set.calls.length).toBe 2
it "selects the account", ->
expect(Actions.focusDefaultMailboxPerspectiveForAccounts).toHaveBeenCalledWith(["B"])