Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test([issue-2737]): pin the load-bearing toast durations

[._.]/ Adam Eivy6c2491f8e749
diff --git a/client/src/hooks/useAIStatusNotifications.test.jsx b/client/src/hooks/useAIStatusNotifications.test.jsx
index bd82f4854a..b7a0d620f2 100644
--- a/client/src/hooks/useAIStatusNotifications.test.jsx
+++ b/client/src/hooks/useAIStatusNotifications.test.jsx
@@ -71,6 +71,12 @@ describe('useAIStatusNotifications — background-op error coalescing', () => {
// The first failure surfaced the provider's real reason.
expect(errs[0].message).toBe('HTTP 401 Unauthorized');
+
+ // Coalesced toasts MUST render with duration: Infinity — the hook owns their
+ // lifetime and dismisses them on window-lapse. A finite duration would let
+ // Toast schedule its own (uncancelled) auto-dismiss and remove a live toast
+ // mid-window. Load-bearing; pin it.
+ expect(errs.every(c => c.opts?.duration === Infinity)).toBe(true);
});
it('keeps user-triggered (non-background) failures immediate, individual, and with the real reason', () => {
@@ -93,6 +99,9 @@ describe('useAIStatusNotifications — background-op error coalescing', () => {
expect(errs[0].message).toBe('HTTP 500 boom');
expect(errs[1].opts?.id).toBe('op-user-b');
expect(errs[1].message).toBe('timeout');
+ // Individual (non-coalesced) toasts use a finite duration and auto-dismiss —
+ // the opposite of the coalesced path's hook-owned Infinity lifetime.
+ expect(errs.every(c => c.opts?.duration === 6000)).toBe(true);
});
it('does NOT coalesce silent-but-user-triggered ops (op-less goal actions) — they still toast individually', () => {