From 31388437487082a155f2cdafb5a804940bf7b496 Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Mon, 11 Jan 2016 13:38:44 -0800 Subject: [PATCH] Fix AccountSwitcher specs --- .../spec/account-switcher-spec.cjsx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/internal_packages/account-sidebar/spec/account-switcher-spec.cjsx b/internal_packages/account-sidebar/spec/account-switcher-spec.cjsx index 90ca7cde7..ddc8d1446 100644 --- a/internal_packages/account-sidebar/spec/account-switcher-spec.cjsx +++ b/internal_packages/account-sidebar/spec/account-switcher-spec.cjsx @@ -1,21 +1,23 @@ React = require 'react/addons' TestUtils = React.addons.TestUtils AccountSwitcher = require './../lib/account-switcher' +AccountSidebarStore = require './../lib/account-sidebar-store' {AccountStore} = require 'nylas-exports' -describe "AccountSwitcher", -> +fdescribe "AccountSwitcher", -> switcher = null beforeEach -> - spyOn(AccountStore, "accounts").andCallFake -> - [ - AccountStore.current(), - { - emailAddress: "dillon@nylas.com", - provider: "exchange" - label: "work" - } - ] + account = AccountStore.accounts()[0] + spyOn(AccountStore, "accounts").andReturn [ + account, + { + emailAddress: "dillon@nylas.com", + provider: "exchange" + label: "work" + } + ] + spyOn(AccountSidebarStore, "currentAccount").andReturn account switcher = TestUtils.renderIntoDocument(