Skip to content

Instantly share code, notes, and snippets.

@trotzig
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trotzig/d5cc595c0c8c4fc6da16 to your computer and use it in GitHub Desktop.
Save trotzig/d5cc595c0c8c4fc6da16 to your computer and use it in GitHub Desktop.
describe('Button', () => {
describe('with a `text` prop', => {
it('renders the text', () => {
var button = React.addons.TestUtils.renderIntoDocument(
<Button text="Click me" />
);
expect(button).toHaveText('Click me');
});
describe('and an `icon` prop', () => {
it('renders the icon', () => {
var button = React.addons.TestUtils.renderIntoDocument(
<Button
text="Click me"
icon="email"
/>
);
expect(button).toHaveIcon('email');
});
it('renders the text', () => {
var button = React.addons.TestUtils.renderIntoDocument(
<Button
text="Click me"
icon="email"
/>
);
expect(button).toHaveText('Click me');
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment