Mailspring/static/package-template/spec/my-composer-button-spec.jsx
Ben Gotow 39768fd9d4 bump(react): 0.13.2 => 0.14.7
Great breakdown of React changes here:
https://github.com/facebook/react/blob/master/CHANGELOG.md#0140-october-7-2015

Due to deprecation warnings, I don't think this will break third-party extensions unless they were doing really bad things.
2016-03-29 01:43:12 -07:00

28 lines
829 B
JavaScript

import {React, ReactDOM} from 'nylas-exports';
const ReactTestUtils = require('react-addons-test-utils')
import MyComposerButton from '../lib/my-composer-button';
describe("MyComposerButton", () => {
beforeEach(() => {
this.component = ReactTestUtils.renderIntoDocument(
<MyComposerButton draftClientId="test" />
);
});
it("should render into the page", () => {
expect(this.component).toBeDefined();
});
it("should have a displayName", () => {
expect(MyComposerButton.displayName).toBe('MyComposerButton');
});
it("should show a dialog box when clicked", () => {
spyOn(this.component, '_onClick');
const buttonNode = ReactDOM.findDOMNode(this.component.refs.button);
ReactTestUtils.Simulate.click(buttonNode);
expect(this.component._onClick).toHaveBeenCalled();
});
});