2015-07-07 02:23:51 +08:00
|
|
|
{ComponentRegistry} = require 'nylas-exports'
|
|
|
|
{activate, deactivate} = require '../lib/main'
|
2015-06-03 10:04:21 +08:00
|
|
|
|
2015-07-07 02:23:51 +08:00
|
|
|
MyMessageSidebar = require '../lib/my-message-sidebar'
|
|
|
|
MyComposerButton = require '../lib/my-composer-button'
|
2015-06-03 10:04:21 +08:00
|
|
|
|
2015-07-07 02:23:51 +08:00
|
|
|
describe "activate", ->
|
|
|
|
it "should register the composer button and sidebar", ->
|
|
|
|
spyOn(ComponentRegistry, 'register')
|
|
|
|
activate()
|
|
|
|
expect(ComponentRegistry.register).toHaveBeenCalledWith(MyComposerButton, {role: 'Composer:ActionButton'})
|
2015-09-25 09:58:53 +08:00
|
|
|
expect(ComponentRegistry.register).toHaveBeenCalledWith(MyMessageSidebar, {role: 'MessageListSidebar:ContactCard'})
|
2015-06-03 10:04:21 +08:00
|
|
|
|
2015-07-07 02:23:51 +08:00
|
|
|
describe "deactivate", ->
|
|
|
|
it "should unregister the composer button and sidebar", ->
|
|
|
|
spyOn(ComponentRegistry, 'unregister')
|
|
|
|
deactivate()
|
|
|
|
expect(ComponentRegistry.unregister).toHaveBeenCalledWith(MyComposerButton)
|
|
|
|
expect(ComponentRegistry.unregister).toHaveBeenCalledWith(MyMessageSidebar)
|