Skip to content

Commit 9faf1db

Browse files
fix: make copyright year dynamic & fix security audit issues (#69)
* chore: trigger CI * chore: sync from main * chore: sync from main * fix: make copyright year dynamic & fix security audit issues (#68) --------- Co-authored-by: chrisert-sync-bot[bot] <chrisert-sync-bot[bot]@users.noreply.github.com>
1 parent 19e53d2 commit 9faf1db

4 files changed

Lines changed: 67 additions & 13 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![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)
55
[![Tests](https://github.com/fernandotonacoder/chrisert/actions/workflows/test.yml/badge.svg)](https://github.com/fernandotonacoder/chrisert/actions/workflows/test.yml)
66
[![Lint](https://github.com/fernandotonacoder/chrisert/actions/workflows/lint.yml/badge.svg)](https://github.com/fernandotonacoder/chrisert/actions/workflows/lint.yml)
7+
[![Security Audit](https://github.com/fernandotonacoder/chrisert/actions/workflows/security-audit.yml/badge.svg)](https://github.com/fernandotonacoder/chrisert/actions/workflows/security-audit.yml)
78

89
<table>
910
<tr>

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/layout/Footer.jsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import {
2-
SiFacebook,
3-
SiInstagram
4-
} from "@icons-pack/react-simple-icons";
1+
import { SiFacebook, SiInstagram } from "@icons-pack/react-simple-icons";
52
import {
63
Marquee,
74
MarqueeContent,
@@ -48,7 +45,7 @@ const CustomFooter = () => (
4845
</Marquee>
4946
</div>
5047
<p className="text-sm text-muted-foreground">
51-
© 2026 Chrisert. Desenvolvido por{" "}
48+
© {new Date().getFullYear()} Chrisert. Desenvolvido por{" "}
5249
<a
5350
href="https://fernandotonacoder.github.io/"
5451
target="_blank"
@@ -61,4 +58,4 @@ const CustomFooter = () => (
6158
</footer>
6259
);
6360

64-
export default CustomFooter;
61+
export default CustomFooter;
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { render, screen } from "@testing-library/react";
2+
import { describe, it, expect } from "vitest";
3+
import CustomFooter from "./Footer";
4+
5+
describe("CustomFooter", () => {
6+
it("renders copyright with current year", () => {
7+
const currentYear = new Date().getFullYear();
8+
render(<CustomFooter />);
9+
10+
expect(
11+
screen.getByText(new RegExp(${currentYear} Chrisert`)),
12+
).toBeInTheDocument();
13+
});
14+
15+
it("renders social media follow text", () => {
16+
render(<CustomFooter />);
17+
18+
expect(screen.getByText("Siga-nos nas redes sociais!")).toBeInTheDocument();
19+
});
20+
21+
it("renders Facebook link with correct attributes", () => {
22+
render(<CustomFooter />);
23+
24+
const facebookLinks = screen.getAllByLabelText(/Abrir Facebook/i);
25+
expect(facebookLinks[0]).toHaveAttribute(
26+
"href",
27+
"https://facebook.com/chrisert.pt",
28+
);
29+
expect(facebookLinks[0]).toHaveAttribute("target", "_blank");
30+
expect(facebookLinks[0]).toHaveAttribute("rel", "noopener noreferrer");
31+
});
32+
33+
it("renders Instagram link with correct attributes", () => {
34+
render(<CustomFooter />);
35+
36+
const instagramLinks = screen.getAllByLabelText(/Abrir Instagram/i);
37+
expect(instagramLinks[0]).toHaveAttribute(
38+
"href",
39+
"https://www.instagram.com/chrisert.pt",
40+
);
41+
expect(instagramLinks[0]).toHaveAttribute("target", "_blank");
42+
expect(instagramLinks[0]).toHaveAttribute("rel", "noopener noreferrer");
43+
});
44+
45+
it("renders developer link", () => {
46+
render(<CustomFooter />);
47+
48+
const devLink = screen.getByRole("link", { name: /Fernando Tona/i });
49+
expect(devLink).toHaveAttribute(
50+
"href",
51+
"https://fernandotonacoder.github.io/",
52+
);
53+
expect(devLink).toHaveAttribute("target", "_blank");
54+
expect(devLink).toHaveAttribute("rel", "noopener noreferrer");
55+
});
56+
});

0 commit comments

Comments
 (0)