Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
hbjORbj committed Jul 11, 2022
1 parent ab84448 commit 18ffb5f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/mui-material/src/Tooltip/Tooltip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,23 @@ describe('<Tooltip />', () => {
expect(getByRole('tooltip')).toBeVisible();
expect(handleFocus.callCount).to.equal(1);
});

it('should handle `onMouseOver` forwarding', () => {
const handleMouseOver = spy();
const { getByRole } = render(
<Tooltip enterDelay={100} title="Tooltip">
<button id="testChild" type="submit" onMouseOver={handleMouseOver}>
Hello World
</button>
</Tooltip>,
);

fireEvent.mouseOver(getByRole('button'));
clock.tick(100);

expect(getByRole('tooltip')).toBeVisible();
expect(handleMouseOver.callCount).to.equal(1);
});
});

describe('prop: delay', () => {
Expand Down

0 comments on commit 18ffb5f

Please sign in to comment.