diff --git a/README.md b/README.md index e010d75..45d685a 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/package-lock.json b/package-lock.json index 8879f00..2b792b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5109,9 +5109,9 @@ } }, "node_modules/react-router": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.10.1.tgz", - "integrity": "sha512-gHL89dRa3kwlUYtRQ+m8NmxGI6CgqN+k4XyGjwcFoQwwCWF6xXpOCUlDovkXClS0d0XJN/5q7kc5W3kiFEd0Yw==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.13.0.tgz", + "integrity": "sha512-PZgus8ETambRT17BUm/LL8lX3Of+oiLaPuVTRH3l1eLvSPpKO3AvhAEb5N7ihAFZQrYDqkvvWfFh9p0z9VsjLw==", "license": "MIT", "dependencies": { "cookie": "^1.0.1", @@ -5131,12 +5131,12 @@ } }, "node_modules/react-router-dom": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.10.1.tgz", - "integrity": "sha512-JNBANI6ChGVjA5bwsUIwJk7LHKmqB4JYnYfzFwyp2t12Izva11elds2jx7Yfoup2zssedntwU0oZ5DEmk5Sdaw==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.13.0.tgz", + "integrity": "sha512-5CO/l5Yahi2SKC6rGZ+HDEjpjkGaG/ncEP7eWFTvFxbHP8yeeI0PxTDjimtpXYlR3b3i9/WIL4VJttPrESIf2g==", "license": "MIT", "dependencies": { - "react-router": "7.10.1" + "react-router": "7.13.0" }, "engines": { "node": ">=20.0.0" diff --git a/src/components/layout/Footer.jsx b/src/components/layout/Footer.jsx index 40f53b7..d2f6b41 100644 --- a/src/components/layout/Footer.jsx +++ b/src/components/layout/Footer.jsx @@ -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, @@ -48,7 +45,7 @@ const CustomFooter = () => (

- © 2026 Chrisert. Desenvolvido por{" "} + © {new Date().getFullYear()} Chrisert. Desenvolvido por{" "} ( ); -export default CustomFooter; \ No newline at end of file +export default CustomFooter; diff --git a/src/components/layout/Footer.test.jsx b/src/components/layout/Footer.test.jsx new file mode 100644 index 0000000..c05950f --- /dev/null +++ b/src/components/layout/Footer.test.jsx @@ -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(); + + expect( + screen.getByText(new RegExp(`© ${currentYear} Chrisert`)), + ).toBeInTheDocument(); + }); + + it("renders social media follow text", () => { + render(); + + expect(screen.getByText("Siga-nos nas redes sociais!")).toBeInTheDocument(); + }); + + it("renders Facebook link with correct attributes", () => { + render(); + + 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(); + + 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(); + + 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"); + }); +});