Skip to content
Closed
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
16a12cc
remove flushMicrotasks
ZeeshanTamboli Jan 9, 2026
d3b9160
remove import
ZeeshanTamboli Jan 9, 2026
9d2fa79
add back flushMicrotasks
ZeeshanTamboli Jan 9, 2026
a7abd17
add waitFor
ZeeshanTamboli Jan 9, 2026
b2a85bd
move clock inside act
ZeeshanTamboli Jan 9, 2026
17b065f
keep mounted
ZeeshanTamboli Jan 9, 2026
3083d85
resort assertion
ZeeshanTamboli Jan 9, 2026
26eff0c
remove assertion
ZeeshanTamboli Jan 9, 2026
d731835
sort assertion
ZeeshanTamboli Jan 9, 2026
fd2976f
use toBeVisible
ZeeshanTamboli Jan 9, 2026
0843b1f
use getByRole
ZeeshanTamboli Jan 9, 2026
677b954
queryByRole
ZeeshanTamboli Jan 9, 2026
8083537
move forward for one second
ZeeshanTamboli Jan 9, 2026
5d7b094
prettier
ZeeshanTamboli Jan 9, 2026
aaeeae1
remove clock.tick
ZeeshanTamboli Jan 9, 2026
7dae39a
Remove focusVisible
ZeeshanTamboli Jan 9, 2026
c16bf55
wait for more time
ZeeshanTamboli Jan 10, 2026
67963e9
Merge branch 'master' into fix-flaky-tooltip-test
ZeeshanTamboli Jan 10, 2026
7fa23d9
rerun CI
ZeeshanTamboli Jan 10, 2026
c538cbc
remove forwarding time
ZeeshanTamboli Jan 10, 2026
3cf6931
rerun CI
ZeeshanTamboli Jan 10, 2026
a9193d4
rerun CI
ZeeshanTamboli Jan 10, 2026
4b6b18c
use waitFor
ZeeshanTamboli Jan 13, 2026
fd56dee
Merge branch 'master' into fix-flaky-tooltip-test
ZeeshanTamboli Jan 13, 2026
7a0f8d1
advance fake clock in waitFor
ZeeshanTamboli Jan 13, 2026
6cbc83e
Remove flushMicrotasks
ZeeshanTamboli Jan 13, 2026
a657818
use focusVisibleSync
ZeeshanTamboli Jan 13, 2026
3e506a4
use InstantTransition
ZeeshanTamboli Jan 13, 2026
522e140
Remove transitionTimout
ZeeshanTamboli Jan 13, 2026
9c121b3
rerun CI
ZeeshanTamboli Jan 13, 2026
b845e9f
try
ZeeshanTamboli Jan 13, 2026
50d3b05
Add better comments
ZeeshanTamboli Jan 13, 2026
c1f0c60
increase time
ZeeshanTamboli Jan 13, 2026
b44344a
increase time
ZeeshanTamboli Jan 13, 2026
76667c0
rerun CI
ZeeshanTamboli Jan 13, 2026
aeff12f
rerun CI
ZeeshanTamboli Jan 13, 2026
bb75993
rerun CI
ZeeshanTamboli Jan 13, 2026
473a819
rerun CI
ZeeshanTamboli Jan 13, 2026
c38ffc2
rerun CI
ZeeshanTamboli Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions packages/mui-material/src/Tooltip/Tooltip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
programmaticFocusTriggersFocusVisible,
reactMajor,
isJsdom,
flushMicrotasks,
} from '@mui/internal-test-utils';
import { camelCase } from 'es-toolkit/string';
import Tooltip, { tooltipClasses as classes } from '@mui/material/Tooltip';
Expand Down Expand Up @@ -592,12 +591,13 @@ describe('<Tooltip />', () => {
const leaveDelay = 111;
const enterDelay = 0;
const transitionTimeout = 10;

render(
<Tooltip
leaveDelay={leaveDelay}
enterDelay={enterDelay}
title="tooltip"
TransitionProps={{ timeout: transitionTimeout }}
slotProps={{ transition: { timeout: transitionTimeout } }}
>
<button id="testChild" type="submit">
Hello World
Expand All @@ -617,10 +617,17 @@ describe('<Tooltip />', () => {

expect(screen.getByRole('tooltip')).toBeVisible();

clock.tick(leaveDelay);
clock.tick(transitionTimeout);
// still mounted at 110ms
clock.tick(leaveDelay - 1);
expect(screen.queryByRole('tooltip')).not.to.equal(null);

await flushMicrotasks();
// leaveDelay is now 111ms
clock.tick(1);
clock.tick(transitionTimeout);
// Advance a little extra time to let the exit transition finish and for Popper to flip `exited`,
// so it can return `null` (unmount). In browser runs, react-transition-group may schedule the
// `onExited` callback in a later tick beyond the configured timeout.
clock.tick(200);

expect(screen.queryByRole('tooltip')).to.equal(null);
});
Expand Down
Loading