Skip to content

Commit

Permalink
CHORE: Linting + Formatting (facebook#20966)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordyvandomselaar committed Mar 11, 2021
1 parent ff3b079 commit 84a5591
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,19 +295,25 @@ describe('EnterLeaveEventPlugin', () => {

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

node.dispatchEvent(new MouseEvent("mouseover", { bubbles: true }));
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);
const node = ReactDOM.render(
<button disabled={true} onMouseLeave={onMouseLeave} />,
container,
);

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

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

0 comments on commit 84a5591

Please sign in to comment.