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", () => {