re-init
This commit is contained in:
41
src/components/Footer.test.tsx
Normal file
41
src/components/Footer.test.tsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import Footer from "@/components/Footer";
|
||||
|
||||
describe("Footer", () => {
|
||||
it("renders footer element", () => {
|
||||
render(<Footer />);
|
||||
expect(screen.getByRole("contentinfo")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders app name", () => {
|
||||
render(<Footer />);
|
||||
expect(screen.getAllByText(/Plant Health ID/i).length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it("renders navigation links", () => {
|
||||
render(<Footer />);
|
||||
const links = screen.getAllByRole("link");
|
||||
expect(links.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it("renders copyright or year", () => {
|
||||
const { container } = render(<Footer />);
|
||||
expect(container.textContent).toMatch(/\d{4}/);
|
||||
});
|
||||
|
||||
it("renders disclaimer text", () => {
|
||||
const { container } = render(<Footer />);
|
||||
expect(container.textContent).toMatch(/beta|preview|accuracy|disclaimer/i);
|
||||
});
|
||||
|
||||
it("renders links section with nav links", () => {
|
||||
render(<Footer />);
|
||||
expect(screen.getByText(/Links/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders about section", () => {
|
||||
render(<Footer />);
|
||||
expect(screen.getAllByText(/About/i).length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user