BS-014 Implement accepted responsive BortStack footer

This commit is contained in:
rob
2026-11-11 15:34:49 +00:00
parent 5bfb128e94
commit 26605771ff
61 changed files with 465 additions and 38 deletions
+15 -9
View File
@@ -1,17 +1,23 @@
import { render, screen } from "@testing-library/react";
import { render, screen, within } from "@testing-library/react";
import { MemoryRouter } from "react-router-dom";
import { describe, expect, it } from "vitest";
import Footer from "./Footer";
describe("Footer", () => {
it("links the developer logo to the configured developer website", () => {
it("presents the business and public navigation without developer attribution", () => {
render(<MemoryRouter><Footer /></MemoryRouter>);
const developerLink = screen.getByRole("link", {
name: "Visit roborto.net, developer website",
});
expect(developerLink).toHaveAttribute("href", "https://roborto.net/");
expect(screen.getByRole("img", { name: "roborto.net" }))
.toHaveAttribute("src", "/developer-logo.svg");
const footer = screen.getByRole("contentinfo");
expect(within(footer).getByText(`© ${new Date().getFullYear()} BortStack`)).toBeVisible();
expect(within(footer).getByText("Navigation", { exact: true })).toBeVisible();
const navigation = within(footer).getByRole("navigation", { name: "Footer navigation" });
expect(within(navigation).getByRole("link", { name: "Contact" })).toHaveAttribute("href", "/contact");
expect(within(footer).getByRole("link", { name: "Privacy" })).toHaveAttribute("href", "/privacy");
for (const [name, href] of [["Services", "/services"], ["Projects", "/projects"], ["About", "/about"]]) {
expect(within(navigation).getByRole("link", { name })).toHaveAttribute("href", href);
}
expect(within(footer).getByText("Software, websites and integrations built around your business.")).toBeVisible();
expect(within(footer).getAllByRole("link")).toHaveLength(5);
expect(footer).not.toHaveTextContent(/roborto/i);
expect(within(footer).queryByRole("img")).not.toBeInTheDocument();
});
});