Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jan 20, 2020
1 parent 18c785f commit 952087a
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion packages/material-ui/src/Tooltip/Tooltip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ describe('<Tooltip />', () => {
it('should use hysteresis with the enterDelay', () => {
const { container } = render(
<Tooltip
{...defaultProps}
enterDelay={111}
leaveDelay={5}
TransitionProps={{ timeout: 6 }}
{...defaultProps}
/>,
);
const children = container.querySelector('#testChild');
Expand Down Expand Up @@ -466,4 +466,22 @@ describe('<Tooltip />', () => {
);
});
});

it('should use the same popper.js instance between two renders', () => {
const popperRef = React.createRef();
const { setProps } = render(
<Tooltip
{...defaultProps}
open={false}
PopperProps={{
popperRef,
}}
/>,
);
setProps({ open: true });
const render1 = popperRef.current;
setProps({ open: true });
const render2 = popperRef.current;
expect(render1).to.equa(render2);
});
});

0 comments on commit 952087a

Please sign in to comment.