mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-15 06:06:35 +08:00
b194d7fb37
Summary: atom-window `sendMessage` was not the same as `browserWindow.webContents.send`. WTF. Save current namespace to config.cson so that it is never null when window opens Don't re-create thread view on namespace change unless the namespace has changed Tests for NamespaceStore state Push worker immediately in workerForNamcespace to avoid creating two connections per namespace Allow \n to be put into sreaming buffer, but only one Clear streaming buffer when we're reconnecting to avoid processing same deltas twice (because of 400msec throttle) Make `onProcessBuffer` more elegant—No functional changes Test Plan: Run tests! Reviewers: evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D1551
27 lines
No EOL
976 B
CoffeeScript
27 lines
No EOL
976 B
CoffeeScript
_ = require 'underscore'
|
|
NamespaceStore = require '../../src/flux/stores/namespace-store'
|
|
|
|
describe "NamespaceStore", ->
|
|
beforeEach ->
|
|
@constructor = NamespaceStore.constructor
|
|
|
|
it "should initialize current() using data saved in config", ->
|
|
state =
|
|
"id": "123",
|
|
"email_address":"bengotow@gmail.com",
|
|
"object":"namespace"
|
|
|
|
spyOn(atom.config, 'get').andCallFake -> state
|
|
instance = new @constructor
|
|
expect(instance.current().id).toEqual(state['id'])
|
|
expect(instance.current().emailAddress).toEqual(state['email_address'])
|
|
|
|
it "should initialize current() to null if data is not present", ->
|
|
spyOn(atom.config, 'get').andCallFake -> null
|
|
instance = new @constructor
|
|
expect(instance.current()).toEqual(null)
|
|
|
|
it "should initialize current() to null if data is invalid", ->
|
|
spyOn(atom.config, 'get').andCallFake -> "this isn't an object"
|
|
instance = new @constructor
|
|
expect(instance.current()).toEqual(null) |