diff --git a/frontend/src/hooks/usePushSubscription.ts b/frontend/src/hooks/usePushSubscription.ts index b4ddcf5..4fa1794 100644 --- a/frontend/src/hooks/usePushSubscription.ts +++ b/frontend/src/hooks/usePushSubscription.ts @@ -224,6 +224,7 @@ export function usePushSubscription(): PushSubscriptionState { console.error('Push subscribe failed:', err); toast.error('Failed to enable push notifications', { description: err instanceof Error ? err.message : 'Check that notifications are allowed', + duration: 8_000, }); return null; } finally { diff --git a/frontend/src/test/usePushSubscription.test.ts b/frontend/src/test/usePushSubscription.test.ts index bfa4f5d..c387878 100644 --- a/frontend/src/test/usePushSubscription.test.ts +++ b/frontend/src/test/usePushSubscription.test.ts @@ -171,9 +171,12 @@ describe('usePushSubscription', () => { }); expect(result.current.loading).toBe(false); - expect(mocks.toast.error).toHaveBeenCalledWith('Failed to enable push notifications', { - description: expect.stringContaining('trusted TLS certificate for service workers'), - }); + expect(mocks.toast.error).toHaveBeenCalledWith( + 'Failed to enable push notifications', + expect.objectContaining({ + description: expect.stringContaining('trusted TLS certificate for service workers'), + }) + ); }, 5_000); it('recreates a stale browser subscription when the server VAPID key changed', async () => {