From 3330fa30c33a2822bc21cde2c0145759fa7a0479 Mon Sep 17 00:00:00 2001 From: joelte Date: Fri, 18 Sep 2026 17:54:16 +0200 Subject: [PATCH] test: Add snapshot tests Added some snapshot tests for Footer About and NotFoundPage. --- PTG/src/About.test.tsx | 12 +++++++ PTG/src/Footer.test.tsx | 11 +++++++ PTG/src/NotFoundPage.test.tsx | 14 ++++++++ PTG/src/__snapshots__/About.test.tsx.snap | 26 +++++++++++++++ PTG/src/__snapshots__/Footer.test.tsx.snap | 32 +++++++++++++++++++ .../__snapshots__/NotFoundPage.test.tsx.snap | 17 ++++++++++ 6 files changed, 112 insertions(+) create mode 100644 PTG/src/About.test.tsx create mode 100644 PTG/src/Footer.test.tsx create mode 100644 PTG/src/NotFoundPage.test.tsx create mode 100644 PTG/src/__snapshots__/About.test.tsx.snap create mode 100644 PTG/src/__snapshots__/Footer.test.tsx.snap create mode 100644 PTG/src/__snapshots__/NotFoundPage.test.tsx.snap diff --git a/PTG/src/About.test.tsx b/PTG/src/About.test.tsx new file mode 100644 index 0000000..3b7145c --- /dev/null +++ b/PTG/src/About.test.tsx @@ -0,0 +1,12 @@ +import { render } from "@testing-library/react"; +import { describe, expect, it } from "vitest"; +import { MemoryRouter } from "react-router-dom"; +import About from "./About"; + +describe("About", () => { + it("matches snapshot", () => { + const { container } = render(, { wrapper: MemoryRouter }); + + expect(container.firstChild).toMatchSnapshot(); + }); +}); diff --git a/PTG/src/Footer.test.tsx b/PTG/src/Footer.test.tsx new file mode 100644 index 0000000..bf1f98c --- /dev/null +++ b/PTG/src/Footer.test.tsx @@ -0,0 +1,11 @@ +import { render } from "@testing-library/react"; +import { describe, expect, it } from "vitest"; +import Footer from "./Footer"; + +describe("Footer", () => { + it("matches snapshot", () => { + const { container } = render(