test(query-devtools/utils): add test for stale vs fresh rank in 'status' sort of 'sortFns'#10674
Conversation
…us' sort of 'sortFns'
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds a test case to ChangesQuery Status Sort Test Coverage
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit e415a00
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
size-limit report 📦
|
🎯 Changes
Add a test for the stale-vs-fresh rank distinction inside the
'status'sort ofsortFnsinquery-devtools/utils.tsx. The existing'status'cases compare across differentgetStatusRanklevels (fetching/inactive/fall back), but never exercise the rank 1 (fresh) vs rank 2 (stale) split, leaving that branch unprotected.The new test:
fetchStatus: 'idle'with astaleTime: 0observer anddataUpdatedAt: 200).fetchStatus: 'idle'with anenabled: falseobserver anddataUpdatedAt: 100).dataUpdatedAt, so a regression that collapses the stale/fresh ranks would fall back todateSortand place the stale query first. Asserting that the fresh query is placed first proves the rank distinction is being respected.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit