mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-08 20:26:20 +08:00
fix(specs): Fix intermittent async error and max event listener leak
An absolute ContactStore spec was causing the listener leak by re-initializing the store and not cleaning it up. Intermittent theme manager failing spec might be caused due to timing of the theme activation
This commit is contained in:
parent
ecf120729a
commit
abc4a6116e
2 changed files with 47 additions and 52 deletions
|
@ -27,16 +27,11 @@ describe "ContactStore", ->
|
|||
ContactStore._contactCache = []
|
||||
ContactStore._fetchOffset = 0
|
||||
ContactStore._accountId = null
|
||||
ContactRankingStore.reset()
|
||||
|
||||
afterEach ->
|
||||
atom.testOrganizationUnit = null
|
||||
|
||||
it "initializes the cache from the DB", ->
|
||||
spyOn(DatabaseStore, "findAll").andCallFake -> Promise.resolve([])
|
||||
ContactStore.constructor()
|
||||
expect(ContactStore._contactCache.length).toBe 0
|
||||
expect(ContactStore._fetchOffset).toBe 0
|
||||
|
||||
describe "when the Account updates from null to valid", ->
|
||||
beforeEach ->
|
||||
spyOn(ContactStore, "_refreshCache")
|
||||
|
|
|
@ -318,7 +318,7 @@ describe "ThemeManager", ->
|
|||
[stylesheetRemovedHandler, stylesheetAddedHandler, stylesheetsChangedHandler] = []
|
||||
|
||||
waitsForPromise ->
|
||||
themeManager.activateThemes()
|
||||
themeManager.activateThemes().then ->
|
||||
|
||||
runs ->
|
||||
atom.styles.onDidRemoveStyleElement styleElementRemovedHandler = jasmine.createSpy("styleElementRemovedHandler")
|
||||
|
|
Loading…
Add table
Reference in a new issue