diff --git a/src/tests/unit/notification-message.test.tsx b/src/tests/unit/notification-message.test.tsx index b419294333..117f631571 100644 --- a/src/tests/unit/notification-message.test.tsx +++ b/src/tests/unit/notification-message.test.tsx @@ -52,6 +52,7 @@ describe("useNotification hook", () => { it("Does shows a message if button is clicked", async () => { vi.spyOn(window, "scrollTo"); + vi.spyOn(window, "setTimeout"); const { getByTitle } = render( { // We expect that the hook has scrolled to the top of the page. expect(window.scrollTo).toHaveBeenCalledWith(0, 0); + // And the message is gone after 5 seconds. + expect(window.setTimeout).toHaveBeenCalledTimes(1); // And shows us a message. expect(wrapper).toMatchInlineSnapshot(`