Mailspring/static/package-template/spec/my-composer-button-spec.cjsx
Ben Gotow 7190ca69f7 refactor(db): change ID system to have clientIDs and serverIDs
Summary: Major ID refactor

Test Plan: edgehill --test

Reviewers: bengotow, dillon

Differential Revision: https://phab.nylas.com/D1946
2015-08-28 11:24:29 -07:00

25 lines
774 B
CoffeeScript

{React} = require 'nylas-exports'
ReactTestUtils = React.addons.TestUtils
MyComposerButton = require '../lib/my-composer-button'
dialogStub =
showMessageBox: jasmine.createSpy('showMessageBox')
describe "MyComposerButton", ->
beforeEach ->
@component = ReactTestUtils.renderIntoDocument(
<MyComposerButton draftClientId="test" />
)
it "should render into the page", ->
expect(@component).toBeDefined()
it "should have a displayName", ->
expect(MyComposerButton.displayName).toBe('MyComposerButton')
it "should show a dialog box when clicked", ->
spyOn(@component, '_onClick')
buttonNode = React.findDOMNode(@component.refs.button)
ReactTestUtils.Simulate.click(buttonNode)
expect(@component._onClick).toHaveBeenCalled()