Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Staging](https://github.com/fernandotonacoder/chrisert/actions/workflows/github-pages-deploy.yml/badge.svg?branch=dev)](https://github.com/fernandotonacoder/chrisert/actions/workflows/github-pages-deploy.yml)
[![Tests](https://github.com/fernandotonacoder/chrisert/actions/workflows/test.yml/badge.svg)](https://github.com/fernandotonacoder/chrisert/actions/workflows/test.yml)
[![Lint](https://github.com/fernandotonacoder/chrisert/actions/workflows/lint.yml/badge.svg)](https://github.com/fernandotonacoder/chrisert/actions/workflows/lint.yml)
[![Security Audit](https://github.com/fernandotonacoder/chrisert/actions/workflows/security-audit.yml/badge.svg)](https://github.com/fernandotonacoder/chrisert/actions/workflows/security-audit.yml)

<table>
<tr>
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions src/components/layout/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
SiFacebook,
SiInstagram
} from "@icons-pack/react-simple-icons";
import { SiFacebook, SiInstagram } from "@icons-pack/react-simple-icons";
import {
Marquee,
MarqueeContent,
Expand Down Expand Up @@ -48,7 +45,7 @@ const CustomFooter = () => (
</Marquee>
</div>
<p className="text-sm text-muted-foreground">
© 2026 Chrisert. Desenvolvido por{" "}
© {new Date().getFullYear()} Chrisert. Desenvolvido por{" "}
<a
href="https://fernandotonacoder.github.io/"
target="_blank"
Expand All @@ -61,4 +58,4 @@ const CustomFooter = () => (
</footer>
);

export default CustomFooter;
export default CustomFooter;
56 changes: 56 additions & 0 deletions src/components/layout/Footer.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { render, screen } from "@testing-library/react";
import { describe, it, expect } from "vitest";
import CustomFooter from "./Footer";

describe("CustomFooter", () => {
it("renders copyright with current year", () => {
const currentYear = new Date().getFullYear();
render(<CustomFooter />);

expect(
screen.getByText(new RegExp(`© ${currentYear} Chrisert`)),
).toBeInTheDocument();
});

it("renders social media follow text", () => {
render(<CustomFooter />);

expect(screen.getByText("Siga-nos nas redes sociais!")).toBeInTheDocument();
});

it("renders Facebook link with correct attributes", () => {
render(<CustomFooter />);

const facebookLinks = screen.getAllByLabelText(/Abrir Facebook/i);
expect(facebookLinks[0]).toHaveAttribute(
"href",
"https://facebook.com/chrisert.pt",
);
expect(facebookLinks[0]).toHaveAttribute("target", "_blank");
expect(facebookLinks[0]).toHaveAttribute("rel", "noopener noreferrer");
});

it("renders Instagram link with correct attributes", () => {
render(<CustomFooter />);

const instagramLinks = screen.getAllByLabelText(/Abrir Instagram/i);
expect(instagramLinks[0]).toHaveAttribute(
"href",
"https://www.instagram.com/chrisert.pt",
);
expect(instagramLinks[0]).toHaveAttribute("target", "_blank");
expect(instagramLinks[0]).toHaveAttribute("rel", "noopener noreferrer");
});

it("renders developer link", () => {
render(<CustomFooter />);

const devLink = screen.getByRole("link", { name: /Fernando Tona/i });
expect(devLink).toHaveAttribute(
"href",
"https://fernandotonacoder.github.io/",
);
expect(devLink).toHaveAttribute("target", "_blank");
expect(devLink).toHaveAttribute("rel", "noopener noreferrer");
});
});