More spec fixes

This commit is contained in:
Ben Gotow 2016-01-25 11:42:39 -08:00
parent c9e5b68f16
commit 617224be29
2 changed files with 7 additions and 5 deletions

View file

@ -9,7 +9,7 @@ describe "AccountSwitcher", ->
beforeEach ->
account = AccountStore.accounts()[0]
spyOn(AccountStore, "accounts").andReturn [
accounts = [
account,
{
emailAddress: "dillon@nylas.com",
@ -17,10 +17,8 @@ describe "AccountSwitcher", ->
label: "work"
}
]
spyOn(SidebarStore, "currentAccount").andReturn account
switcher = TestUtils.renderIntoDocument(
<AccountSwitcher />
<AccountSwitcher accounts={accounts} focusedAccounts={[account]} />
)
it "doesn't render the dropdown if nothing clicked", ->
@ -49,5 +47,6 @@ describe "AccountSwitcher", ->
items = TestUtils.scryRenderedDOMComponentsWithClass dropdown, "secondary-item"
newAccountButton = TestUtils.scryRenderedDOMComponentsWithClass dropdown, "new-account-option"
expect(items.length).toBe 3
# The unified Inbox item, then both accounts, then the manage item
expect(items.length).toBe 4
expect(newAccountButton.length).toBe 1

View file

@ -3,6 +3,8 @@ DatabaseStore = require '../stores/database-store'
QueryRange = require './query-range'
MutableQueryResultSet = require './mutable-query-result-set'
verbose = false
class QuerySubscription
constructor: (@_query, @_options = {}) ->
@_set = null
@ -105,6 +107,7 @@ class QuerySubscription
return false
log: (msg) =>
return unless verbose
console.log(msg) if @_query._klass.name is 'Thread'
update: =>