mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-09 17:55:35 +08:00
25 lines
772 B
Text
25 lines
772 B
Text
|
{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 draftLocalId="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()
|