BS-014 Implement accepted responsive BortStack footer
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user