Skip to content

Commit

Permalink
Added MemoryRouter for testing the Link component
Browse files Browse the repository at this point in the history
  • Loading branch information
bzzz-coding committed Feb 5, 2024
1 parent fec4279 commit 0e16dec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/pages/LandingPage/LandingPageIntro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function LandingPageIntro() {
products, programs, and services.
</p>
<Link
to="/qualifier/1"
to="qualifier/1"
className="h-min-12 px-14 py-3 mb-10 rounded-x-large text-xl font-bold bg-blue-dark hover:bg-blue-dark-hover hover:shadow-lg focus:bg-blue-dark-focused text-white"
>
Join us
Expand Down
7 changes: 6 additions & 1 deletion frontend/tests/pages/LandingPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ 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;

describe("Landing Page", () => {
test("Landing Page dialog", async () => {
const user = userEvent.setup();
render(<LandingPage />);
render(
<MemoryRouter>
<LandingPage />
</MemoryRouter>
);

expect(screen.getByRole("presentation")).toHaveClass("hidden");

Expand Down

0 comments on commit 0e16dec

Please sign in to comment.