Skip to content

Commit 548a685

Browse files
committed
fix(Footer): update copyright year to display current year dynamically
1 parent e475f4f commit 548a685

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/__tests__/components/Footer.test.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ describe("Footer", () => {
3939
expect(screen.getByText(/© CS Internship/)).toBeInTheDocument();
4040
});
4141

42-
it("should display year 2025", () => {
42+
it("should display year", () => {
4343
render(<Footer />);
44-
expect(screen.getByText(/2025/)).toBeInTheDocument();
44+
const currentYear = new Date().getFullYear();
45+
expect(screen.getByText(new RegExp(currentYear))).toBeInTheDocument();
4546
});
4647

4748
it("should have page-footer class", () => {

src/components/Footer.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import React from "react";
22

33
const Footer = () => {
4+
const currentYear = new Date().getFullYear();
5+
46
return (
57
<a
68
href="https://github.com/cs-internship"
79
className={"page-footer"}
810
target="_blank"
911
rel="noreferrer"
1012
>
11-
&copy; CS Internship 2025
13+
&copy; CS Internship {currentYear}
1214
</a>
1315
);
1416
};

0 commit comments

Comments
 (0)