Skip to content

Commit

Permalink
Add additional test to cover mouse events on children of disabled par…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
nhunzaker committed Nov 17, 2016
1 parent 1ffbdab commit 59e7d36
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,18 @@ describe('SimpleEventPlugin', function() {

it('clicking a child of a disabled element does not register a click', function() {
var element = ReactTestUtils.renderIntoDocument(
<button onClick={onClick} disabled={true}><span /></button>
<button onClick={onClick} disabled={true}><span /></button>
);
var child = ReactDOM.findDOMNode(element).querySelector('span');

onClick.mockClear();
ReactTestUtils.SimulateNative.click(child);
expect(onClick.mock.calls.length).toBe(0);
});

it('does not trigger click properties for children of disabled elements', function() {
var element = ReactTestUtils.renderIntoDocument(
<button disabled={true}><span onClick={onClick} /></button>
);
var child = ReactDOM.findDOMNode(element).querySelector('span');

Expand Down

0 comments on commit 59e7d36

Please sign in to comment.