diff --git a/src/renderer/src/app-shell/use-profile-state-save-delay-notice.sonner.test.tsx b/src/renderer/src/app-shell/use-profile-state-save-delay-notice.sonner.test.tsx
index 471dfaf3ed5..44242495404 100644
--- a/src/renderer/src/app-shell/use-profile-state-save-delay-notice.sonner.test.tsx
+++ b/src/renderer/src/app-shell/use-profile-state-save-delay-notice.sonner.test.tsx
@@ -11,9 +11,9 @@ const title = 'Profile storage is taking longer than usual'
const frames: FrameRequestCallback[] = []
const listeners = new Set<(delayed: boolean) => void>()
-function Notice() {
+function Notice({ closeButton = false }: { closeButton?: boolean }) {
useProfileStateSaveDelayNotice()
- return
+ return
}
beforeEach(() => {
@@ -97,6 +97,16 @@ it('does not let StrictMode cleanup dismiss the initial delayed snapshot', async
expect(view.queryAllByText(title)).toHaveLength(1)
})
+it('lets the user close the warning with the app toaster close button', async () => {
+ const view = render()
+ await advanceTimers()
+ expect(view.queryByText(title)).not.toBeNull()
+
+ act(() => view.getByRole('button', { name: 'Close toast' }).click())
+ await finishDismissal()
+ expect(view.queryByText(title)).toBeNull()
+})
+
it('keeps a new warning if recovery and another delay arrive before a dismissal frame', async () => {
const view = render()
await advanceTimers()
diff --git a/src/renderer/src/app-shell/use-profile-state-save-delay-notice.test.tsx b/src/renderer/src/app-shell/use-profile-state-save-delay-notice.test.tsx
index d673aba02c1..05018d5aef7 100644
--- a/src/renderer/src/app-shell/use-profile-state-save-delay-notice.test.tsx
+++ b/src/renderer/src/app-shell/use-profile-state-save-delay-notice.test.tsx
@@ -62,9 +62,7 @@ it('restores a persistent warning from main and clears it on completion', async
{
id: undefined,
description: 'Further saves may be delayed while this operation finishes.',
- duration: Infinity,
- dismissible: false,
- closeButton: false
+ duration: Infinity
}
)
publish(false)
diff --git a/src/renderer/src/app-shell/use-profile-state-save-delay-notice.ts b/src/renderer/src/app-shell/use-profile-state-save-delay-notice.ts
index 99815c1c3f4..7b35bba58eb 100644
--- a/src/renderer/src/app-shell/use-profile-state-save-delay-notice.ts
+++ b/src/renderer/src/app-shell/use-profile-state-save-delay-notice.ts
@@ -34,9 +34,7 @@ export function useProfileStateSaveDelayNotice(): void {
'app.saving.delayedDescription',
'Further saves may be delayed while this operation finishes.'
),
- duration: Infinity,
- dismissible: false,
- closeButton: false
+ duration: Infinity
}
)
}