mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-24 09:16:07 +08:00
dff5465931
Summary: ThreadStore should be done loading as soon as threads are available SearchSuggestionStore should use ContactsStore for contact results Contact Store should not "filter all, take 10" it should only filter until it has 10. It should also check against "Ben Gotow" as well as "Ben" and "Gotow", so I can type "Ben Go" Sometimes participants are "Ben Gotow <ben@g.com>", "ben@g.com". If we get zero contacts after removing Me, put "Me" back in... Fix "Update Available" notification, broken reference to `atom.views.getView(atom.workspace)` A bit more debugging around cursors. Need to handle this case soon. Only use atomWorkspace if it exists. Fix for dragging next to / around toolbar window controls Consolidate the display of Contacts in menus into a single MenuItem subclass Update Template Popover styling fetchFromCache should only remove thread loading indicator *IF* it found results in the cache. Doh... Give the thread list "Name" column a fixed width (mg) Better styling of message list collapsed mode, rage against user selection and cursor: pointer Occasionally admin.inboxapp.com returns bogus data Sebaastian feedback on thread list Test Plan: Run tests Reviewers: evan Reviewed By: evan Differential Revision: https://review.inboxapp.com/D1350
72 lines
2.3 KiB
CoffeeScript
72 lines
2.3 KiB
CoffeeScript
_ = require 'underscore-plus'
|
|
proxyquire = require 'proxyquire'
|
|
Reflux = require 'reflux'
|
|
{Actions} = require 'inbox-exports'
|
|
|
|
stubUpdaterState = null
|
|
stubUpdaterReleaseVersion = null
|
|
ipcSendArgs = null
|
|
|
|
PackageMain = proxyquire "../lib/main",
|
|
"ipc":
|
|
send: ->
|
|
ipcSendArgs = arguments
|
|
"remote":
|
|
getGlobal: (global) ->
|
|
autoUpdateManager:
|
|
releaseVersion: stubUpdaterReleaseVersion
|
|
getState: -> stubUpdaterState
|
|
|
|
describe "NotificationUpdateAvailable", ->
|
|
beforeEach ->
|
|
stubUpdaterState = 'idle'
|
|
stubUpdaterReleaseVersion = undefined
|
|
ipcSendArgs = null
|
|
@package = PackageMain
|
|
|
|
afterEach ->
|
|
@package.deactivate()
|
|
|
|
describe "activate", ->
|
|
it "should display a notification immediately if one is available", ->
|
|
spyOn(@package, 'displayNotification')
|
|
stubUpdaterState = 'update-available'
|
|
@package.activate()
|
|
expect(@package.displayNotification).toHaveBeenCalled()
|
|
|
|
it "should not display a notification if no update is avialable", ->
|
|
spyOn(@package, 'displayNotification')
|
|
stubUpdaterState = 'no-update-available'
|
|
@package.activate()
|
|
expect(@package.displayNotification).not.toHaveBeenCalled()
|
|
|
|
it "should listen for `window:update-available`", ->
|
|
spyOn(atom, 'onUpdateAvailable').andCallThrough()
|
|
@package.activate()
|
|
expect(atom.onUpdateAvailable).toHaveBeenCalled()
|
|
|
|
describe "displayNotification", ->
|
|
beforeEach ->
|
|
@package.activate()
|
|
|
|
it "should fire a postNotification Action", ->
|
|
spyOn(Actions, 'postNotification')
|
|
@package.displayNotification()
|
|
expect(Actions.postNotification).toHaveBeenCalled()
|
|
|
|
it "should include the version if one is provided", ->
|
|
spyOn(Actions, 'postNotification')
|
|
|
|
version = '0.515.0-123123'
|
|
@package.displayNotification(version)
|
|
expect(Actions.postNotification).toHaveBeenCalled()
|
|
|
|
notifOptions = Actions.postNotification.mostRecentCall.args[0]
|
|
expect(notifOptions.message.indexOf(version) > 0).toBe(true)
|
|
|
|
describe "when the action is taken", ->
|
|
it "should fire the `application:install-update` IPC event", ->
|
|
Actions.notificationActionTaken({notification: {}, action: {id: 'release-bar:install-update'}})
|
|
expect(ipcSendArgs).toEqual(0: 'command', 1: 'application:install-update')
|
|
|