From 8c028160fa1e33c18fa64af4b07b251a3306cb04 Mon Sep 17 00:00:00 2001 From: Brianna Cerkiewicz Date: Fri, 17 Jan 2025 12:37:14 -0800 Subject: [PATCH] test: vitest for external transfer page --- .../transfers/ExternalTransferPage.test.tsx | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 bciers/apps/administration/tests/components/transfers/ExternalTransferPage.test.tsx diff --git a/bciers/apps/administration/tests/components/transfers/ExternalTransferPage.test.tsx b/bciers/apps/administration/tests/components/transfers/ExternalTransferPage.test.tsx new file mode 100644 index 0000000000..146f418835 --- /dev/null +++ b/bciers/apps/administration/tests/components/transfers/ExternalTransferPage.test.tsx @@ -0,0 +1,26 @@ +import { render, screen } from "@testing-library/react"; +import ExternalTransferPage from "@/administration/app/components/transfers/ExternalTransferPage"; + +describe("ExternalTransferPage component", () => { + beforeEach(async () => { + vi.resetAllMocks(); + }); + + it("renders the external transfers apge", async () => { + render(await ExternalTransferPage()); + expect( + screen.getByRole("heading", { name: /Report Transfers and Closures/i }), + ).toBeVisible(); + // Note component + expect( + screen.getByRole("link", { name: "Report an Event" }), + ).toHaveAttribute( + "href", + "https://submit.digital.gov.bc.ca/app/form/submit?f=d26fb011-2846-44ed-9f5c-26e2756a758f", + ); + + expect( + screen.getByRole("link", { name: "GHGRegulator@gov.bc.ca" }), + ).toHaveAttribute("href", "mailto:GHGRegulator@gov.bc.ca"); + }); +});