From 0e16decca34ac0f6ba0a2328b9d538e96f812698 Mon Sep 17 00:00:00 2001 From: bzzz-coding <86077274+bzzz-coding@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:32:52 -0800 Subject: [PATCH] Added MemoryRouter for testing the Link component --- frontend/src/pages/LandingPage/LandingPageIntro.tsx | 2 +- frontend/tests/pages/LandingPage.test.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/LandingPage/LandingPageIntro.tsx b/frontend/src/pages/LandingPage/LandingPageIntro.tsx index 370e4ae4..8f0689f6 100644 --- a/frontend/src/pages/LandingPage/LandingPageIntro.tsx +++ b/frontend/src/pages/LandingPage/LandingPageIntro.tsx @@ -24,7 +24,7 @@ function LandingPageIntro() { products, programs, and services.

Join us diff --git a/frontend/tests/pages/LandingPage.test.tsx b/frontend/tests/pages/LandingPage.test.tsx index 483ffb38..4fcd72af 100644 --- a/frontend/tests/pages/LandingPage.test.tsx +++ b/frontend/tests/pages/LandingPage.test.tsx @@ -8,6 +8,7 @@ import { config } from "react-transition-group"; // Internal imports import { LandingPage } from "pages/LandingPage/LandingPage"; +import { MemoryRouter } from "react-router-dom"; // Disables animation transition time so it will not hamper testing config.disabled = true; @@ -15,7 +16,11 @@ config.disabled = true; describe("Landing Page", () => { test("Landing Page dialog", async () => { const user = userEvent.setup(); - render(); + render( + + + + ); expect(screen.getByRole("presentation")).toHaveClass("hidden");