diff --git a/editor.planx.uk/src/components/Feedback/FeedbackPhaseBanner.test.tsx b/editor.planx.uk/src/components/Feedback/FeedbackPhaseBanner.test.tsx index f2e6a825af..fd4d20216a 100644 --- a/editor.planx.uk/src/components/Feedback/FeedbackPhaseBanner.test.tsx +++ b/editor.planx.uk/src/components/Feedback/FeedbackPhaseBanner.test.tsx @@ -1,6 +1,3 @@ -import "@testing-library/jest-dom/extend-expect"; - -import { fireEvent } from "@testing-library/react"; import React from "react"; import { axe, setup } from "testUtils"; @@ -27,27 +24,27 @@ describe("FeedbackPhaseBanner presentation and functionality", () => { expect(getByText("feedback")).toBeInTheDocument(); }); - test("clicking on feedback link calls handleFeedbackClick", () => { - const { getByText } = setup( + test("clicking on feedback link calls handleFeedbackClick", async () => { + const { getByText, user } = setup( , ); - fireEvent.click(getByText("feedback")); + await user.click(getByText("feedback")); expect(handleFeedbackClick).toHaveBeenCalledTimes(1); }); - test("clicking on 'Report an issue with this page' button calls handleReportAnIssueClick", () => { - const { getByText } = setup( + test("clicking on 'Report an issue with this page' button calls handleReportAnIssueClick", async () => { + const { getByText, user } = setup( , ); - fireEvent.click(getByText("Report an issue with this page")); + await user.click(getByText("Report an issue with this page")); expect(handleReportAnIssueClick).toHaveBeenCalledTimes(1); }); });