Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] Isolate Tooltip tests more #24834

Merged
merged 1 commit into from
Feb 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To match the test description "should handle autoFocus + onFocus forwarding". The "+ onFocus forwarding" part was not tested as far as I can tell.

});
});

Expand Down