Skip to content

Commit

Permalink
[test] Isolate Tooltip tests more
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Feb 8, 2021
1 parent 6d260f7 commit f95d1aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/material-ui/src/Tooltip/Tooltip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
} from 'test/utils';
import { camelCase } from 'lodash/string';
import Tooltip, { testReset } from './Tooltip';
import Input from '../Input';

async function raf() {
return new Promise((resolve) => {
Expand Down Expand Up @@ -459,11 +458,12 @@ describe('<Tooltip />', () => {
});

it('should handle autoFocus + onFocus forwarding', () => {
const handleFocus = spy();
const AutoFocus = (props) => (
<div>
{props.open ? (
<Tooltip enterDelay={100} title="Title">
<Input value="value" autoFocus />
<input autoFocus onFocus={handleFocus} />
</Tooltip>
) : null}
</div>
Expand All @@ -477,6 +477,7 @@ describe('<Tooltip />', () => {
});

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

Expand Down

0 comments on commit f95d1aa

Please sign in to comment.