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:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user