Skip to content

Commit

Permalink
[Select] Test if child passed to onChange handler
Browse files Browse the repository at this point in the history
  • Loading branch information
akaxiaok committed Sep 12, 2018
1 parent 63f9dab commit 816f5cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/material-ui/src/Select/Select.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ describe('<Select />', () => {
const onChangeHandler = spy();
const wrapper = mount(<Select onChange={onChangeHandler} {...defaultProps} value={'1'} />);
wrapper.find('[role="button"]').simulate('click');
wrapper.find(MenuItem).at(1).simulate('click');
wrapper
.find(MenuItem)
.at(1)
.simulate('click');
const selected = onChangeHandler.args[0][1];
assert.strictEqual(React.isValidElement(selected), true, 'should b be a element');
});
Expand Down

0 comments on commit 816f5cd

Please sign in to comment.