File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,9 +39,10 @@ describe("Footer", () => {
3939 expect ( screen . getByText ( / © C S I n t e r n s h i p / ) ) . toBeInTheDocument ( ) ;
4040 } ) ;
4141
42- it ( "should display year 2025 " , ( ) => {
42+ it ( "should display year" , ( ) => {
4343 render ( < Footer /> ) ;
44- expect ( screen . getByText ( / 2 0 2 5 / ) ) . toBeInTheDocument ( ) ;
44+ const currentYear = new Date ( ) . getFullYear ( ) ;
45+ expect ( screen . getByText ( new RegExp ( currentYear ) ) ) . toBeInTheDocument ( ) ;
4546 } ) ;
4647
4748 it ( "should have page-footer class" , ( ) => {
Original file line number Diff line number Diff line change 11import React from "react" ;
22
33const 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- © CS Internship 2025
13+ © CS Internship { currentYear }
1214 </ a >
1315 ) ;
1416} ;
You can’t perform that action at this time.
0 commit comments