Commit 450b470
test(router-core): fix flakiness of store-updates 'preload then navigate' test (#4995)
It turns out the 'hover preload, then navigate, w/ async loaders' test
in
`packages/react-router/tests/store-updates-during-navigation.test.tsx`
was sometimes (but very rarely) yielding 16 updates instead of the
expected 15. This PR makes minimal changes to this test so that it's now
reliably 14.
I'm not exactly sure where we lost that 1 update, so we might not be
measuring exactly the same thing. But it's still worth it to have a
robust test suite.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Improved reliability of hover preloading and navigation behavior tests
by introducing realistic loader delays and aligning interaction timing,
reducing flakiness.
* Updated assertions for store updates during navigation to reflect
observed behavior, ensuring more stable and predictable test outcomes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 0199198 commit 450b470
1 file changed
Lines changed: 3 additions & 2 deletions
File tree
- packages/react-router/tests
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
| |||
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
211 | | - | |
| 212 | + | |
212 | 213 | | |
213 | 214 | | |
0 commit comments