From 14bcb366c9e306586040bd58dbedeece5219399d Mon Sep 17 00:00:00 2001 From: Vanessa Tran Date: Fri, 11 Jul 2025 14:59:21 -0600 Subject: [PATCH 1/2] fix(#2881): temporary notification set 0 to stop auto-dismiss --- .../temporary-notification-controller.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/common/src/lib/temporary-notification-controller/temporary-notification-controller.ts b/libs/common/src/lib/temporary-notification-controller/temporary-notification-controller.ts index 6d393a230d..b338c02e1c 100644 --- a/libs/common/src/lib/temporary-notification-controller/temporary-notification-controller.ts +++ b/libs/common/src/lib/temporary-notification-controller/temporary-notification-controller.ts @@ -22,9 +22,8 @@ const TypesRequiringDuration: GoabTemporaryNotificationType[] = ["basic", "succe function show(message: string, opts?: Partial): string { const uuid = crypto.randomUUID(); opts = { uuid, type: "basic", ...(opts || {}) }; - // set default duration for certain notification types - if (!opts.duration && opts.type && TypesRequiringDuration.includes(opts.type)) { + if (opts.duration === undefined && opts.type && TypesRequiringDuration.includes(opts.type)) { opts.duration = "short"; } From d9f48594714cd301658b643d30810aec7b871657 Mon Sep 17 00:00:00 2001 From: Vanessa Tran Date: Fri, 11 Jul 2025 17:10:09 -0600 Subject: [PATCH 2/2] fix(#2850): temporary notification browser test --- ...mporary-notification-ctrl.browser.spec.tsx | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/libs/react-components/specs/temporary-notification-ctrl.browser.spec.tsx b/libs/react-components/specs/temporary-notification-ctrl.browser.spec.tsx index e818cd0852..427aab30dc 100644 --- a/libs/react-components/specs/temporary-notification-ctrl.browser.spec.tsx +++ b/libs/react-components/specs/temporary-notification-ctrl.browser.spec.tsx @@ -217,24 +217,24 @@ describe("Temporary Notification Controller", () => { }; const result = render(); - const notification = result.getByTestId("cancel-notification"); - const actionButton = result.getByRole("button"); - + await vi.waitFor(async () => { sendCancellableNotificationWithoutNotificationResponse("Notification with cancel action", "cancel-notification"); - - // Verify the notification is displayed + + const notification = result.getByTestId("cancel-notification"); expect(notification.elements().length).toBe(1); + }, { timeout: 5000 }); - // Click the cancel button - expect(actionButton.elements().length).toBe(1); - await actionButton.click(); + // Get the action button and click it + const actionButton = result.getByRole("button"); + expect(actionButton.elements().length).toBe(1); + await actionButton.click(); - // Verify the notification is removed - await vi.waitFor(() => { - expect(notification.elements().length).toBe(0); - }); - }); + // Verify the notification is removed + await vi.waitFor(() => { + const notification = result.getByTestId("cancel-notification"); + expect(notification.elements().length).toBe(0); + }, { timeout: 5000 }); }) it.skip("should handle progress updates", async function () {