From 00997592794aec0331592c0fb7ef3dd9f0f159a2 Mon Sep 17 00:00:00 2001 From: Aleksandr Gumroian Date: Wed, 2 Oct 2024 13:16:37 +0200 Subject: [PATCH] Fix tests --- src/context/alertContext/__tests__/AlertContext.test.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/context/alertContext/__tests__/AlertContext.test.js b/src/context/alertContext/__tests__/AlertContext.test.js index 2bec602..573ad48 100644 --- a/src/context/alertContext/__tests__/AlertContext.test.js +++ b/src/context/alertContext/__tests__/AlertContext.test.js @@ -43,14 +43,17 @@ describe("AlertContext", () => { expect(componentContainer).toMatchSnapshot(); }); - it("should dismiss alert with alert button", () => { + it("should dismiss alert with alert button", async () => { fireEvent.click(getByText(componentContainer, "Set alert")); // Alert is present expect(getByText(componentContainer, "Alert content")).toBeDefined(); fireEvent.click(componentContainer.querySelector(".btn-close")); // Alert is gone - expect(queryByText(componentContainer, "Alert content")).toBeNull(); + await (() => + expect( + queryByText(componentContainer, "Alert content") + ).toBeNull()); }); it("should dismiss alert with external button", () => {