Skip to content

Commit

Permalink
Add failing tests (facebook#20966)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordyvandomselaar committed Mar 11, 2021
1 parent 10cc400 commit 7616771
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,22 @@ describe('EnterLeaveEventPlugin', () => {

expect(onMouseEnter).toHaveBeenCalledTimes(1);
});

it('should not trigger mouseEnter events for disabled elements', () => {
const onMouseEnter = jest.fn();
const node = ReactDOM.render(<button disabled onMouseEnter={onMouseEnter}/>, container);

node.dispatchEvent(new MouseEvent("mouseover", { bubbles: true }));

expect(onMouseEnter).toBeCalledTimes(0);
})

it('should not trigger mouseLeave events for disabled elements', () => {
const onMouseLeave = jest.fn();
const node = ReactDOM.render(<button disabled onMouseLeave={onMouseLeave}/>, container);

node.dispatchEvent(new MouseEvent("mouseout", { bubbles: true }));

expect(onMouseLeave).toBeCalledTimes(0);
})
});

0 comments on commit 7616771

Please sign in to comment.