test(documents): replace 1 setTimeout sleep in bulk-edit page with vi.waitFor

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-11 17:42:58 +02:00
parent 1b9cefff86
commit 57ac82b823

View File

@@ -30,10 +30,7 @@ describe('documents/bulk-edit page', () => {
it('redirects to /documents when no documents are selected', async () => {
render(BulkEditPage, { props: {} });
// onMount runs immediately — give it a tick
await new Promise((r) => setTimeout(r, 50));
expect(gotoSpy).toHaveBeenCalledWith('/documents');
await vi.waitFor(() => expect(gotoSpy).toHaveBeenCalledWith('/documents'));
});
it('shows the loading spinner while fetching batch metadata', async () => {