Skip to content

Commit 3efc63c

Browse files
committed
fix(test): stabilize RerankerDetailPage delete test on Node 20
Filter GET assertions to only count requests occurring after the DELETE call index, avoiding false positives from stale query refetches that fire during user interaction on slower runtimes.
1 parent d0bbed1 commit 3efc63c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/frontend/src/pages/rerankers/RerankerDetailPage.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,11 @@ describe('RerankerDetailPage', () => {
186186
expect(state.deleted).toBe('my-rrf');
187187
});
188188

189+
// Only count GETs that occur AFTER the DELETE call (ignore stale refetches
190+
// that may fire during the click interaction on slower runtimes like Node 20).
191+
const deleteIdx = state.calls.findIndex((c) => c.method === 'DELETE');
189192
const getAfterDelete = state.calls.filter(
190-
(c) => c.method === 'GET' && c.path.includes('/ai/rerankers/my-rrf'),
193+
(c, i) => i > deleteIdx && c.method === 'GET' && c.path.includes('/ai/rerankers/my-rrf'),
191194
);
192195
expect(getAfterDelete).toHaveLength(0);
193196
});

0 commit comments

Comments
 (0)