Skip to content

Commit

Permalink
Add test for DIalogTitle children as a string (mui#6386)
Browse files Browse the repository at this point in the history
  • Loading branch information
agamrafaeli authored and oliviertassinari committed Mar 19, 2017
1 parent 2c5711a commit 1216598
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Dialog/DialogTitle.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ describe('<DialogTitle />', () => {
assert.strictEqual(wrapper.hasClass(classes.root), true, 'should have the root class');
});

it('should render children', () => {
it('should render JSX children', () => {
const children = <p className="test">Hello</p>;
const wrapper = shallow(<DialogTitle>{children}</DialogTitle>);
assert.strictEqual(wrapper.childAt(0).equals(children), true);
});

it('should render string children as given string', () => {
const children = 'Hello';
const wrapper = shallow(<DialogTitle>{children}</DialogTitle>);
assert.strictEqual(wrapper.childAt(0).props().children, children);
});
});

0 comments on commit 1216598

Please sign in to comment.