Commit b9d7ad1
authored
test(core): fix flaky focusNode test by using fake timers for rAF (#15865)
jsdom polyfills requestAnimationFrame as setTimeout(cb, 16). The
mountWithChart helper only awaited setTimeout(0) callbacks, so in CI
poll() (which calls capturePositions) had not yet fired when selectNode
was called, leaving storedPositions empty and causing focusNode to be
skipped — a non-deterministic race.
Replace the manual setTimeout(0) waits with vi.useFakeTimers() +
vi.runAllTimersAsync() so the rAF callback fires before assertions run.1 parent 034f749 commit b9d7ad1
1 file changed
Lines changed: 6 additions & 4 deletions
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
317 | 318 | | |
318 | 319 | | |
319 | 320 | | |
| |||
323 | 324 | | |
324 | 325 | | |
325 | 326 | | |
326 | | - | |
327 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
328 | 330 | | |
329 | 331 | | |
330 | | - | |
331 | | - | |
| 332 | + | |
332 | 333 | | |
| 334 | + | |
333 | 335 | | |
334 | 336 | | |
335 | 337 | | |
| |||
0 commit comments