Skip to content

Commit 3ba1369

Browse files
committed
test(useLogoutIfAccessDenied): wait 2 secs to verify that no redirect has happened
1 parent 2479c77 commit 3ba1369

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/ra-core/src/auth/useLogoutIfAccessDenied.spec.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,17 @@ describe('useLogoutIfAccessDenied', () => {
280280
</AuthContext.Provider>
281281
</TestMemoryRouter>
282282
);
283-
284283
await waitFor(() => {
285284
expect(authProvider.logout).toHaveBeenCalledTimes(0);
286285
expect(notify).toHaveBeenCalledWith('Access denied', {
287286
type: 'error',
288287
});
289288
expect(notify).toHaveBeenCalledTimes(1);
290-
expect(screen.queryByText('Login page')).toBeNull();
289+
});
290+
await waitFor(() => {
291+
expect(screen.queryByText('Login page')).toBeNull();
292+
}, {
293+
timeout: 2000
291294
});
292295
});
293296
});

0 commit comments

Comments
 (0)