@@ -25,10 +25,16 @@ jest.mock("next/navigation", () => ({
2525jest . mock ( "@/components/themed-components/registration-link" , ( ) => {
2626 return {
2727 __esModule : true ,
28- default : ( { children, className } : { children ?: React . ReactNode ; className ?: string } ) => (
29- < div data-testid = "registration-link" className = { className } role = "link" aria-label = "Registration Link" >
30- { children || "Registration Link" }
31- </ div >
28+ default : ( { className } : { className ?: string } ) => (
29+ < a
30+ data-testid = "registration-link"
31+ href = "https://hackrpi2025.devpost.com/"
32+ target = "_blank"
33+ rel = "noopener noreferrer"
34+ className = { className }
35+ >
36+ Register Here!
37+ </ a >
3238 ) ,
3339 } ;
3440} ) ;
@@ -110,19 +116,16 @@ describe("AboutUs Component", () => {
110116 } ) ;
111117
112118 it ( "renders the registration link with correct styling" , ( ) => {
113- // 2025 best practice: Render the component and get the container
114119 const { container } = renderWithProviders ( < AboutUs /> ) ;
115120
116- // 2025 best practice: Use data-testid for more reliable selection
117- const registrationLink = screen . getByTestId ( "registration-link" ) ;
121+ const registrationLink = screen . getByRole ( "link" , { name : / r e g i s t e r h e r e ! / i } ) ;
118122 expect ( registrationLink ) . toBeInTheDocument ( ) ;
119123 expect ( registrationLink ) . toHaveClass ( "text-xl" ) ;
124+ expect ( registrationLink ) . toHaveAttribute ( "href" , "https://hackrpi2025.devpost.com/" ) ;
120125
121- // 2025 best practice: Find the REGISTER NOW text using a pattern
122126 const registerNowText = screen . getByText ( / R E G I S T E R N O W ! / i) ;
123127 expect ( registerNowText ) . toBeInTheDocument ( ) ;
124128
125- // Verify they are both in the document but don't assert they're in the same container
126129 expect ( container ) . toContainElement ( registrationLink ) ;
127130 expect ( container ) . toContainElement ( registerNowText ) ;
128131 } ) ;
@@ -137,7 +140,7 @@ describe("AboutUs Component", () => {
137140
138141 // Check styling directly on the element with data-testid
139142 expect ( registerBanner ) . toHaveClass ( "bg-hackrpi-secondary-orange" ) ;
140- expect ( registerBanner ) . toHaveClass ( "text-black " ) ;
143+ expect ( registerBanner ) . toHaveClass ( "text-white " ) ;
141144 expect ( registerBanner ) . toHaveClass ( "overflow-hidden" ) ;
142145 expect ( registerBanner ) . toHaveClass ( "whitespace-nowrap" ) ;
143146 } ) ;
@@ -187,7 +190,7 @@ describe("AboutUs Component", () => {
187190
188191 // Check that key elements are still visible on mobile
189192 expect ( screen . getByRole ( "heading" , { name : / A b o u t H a c k R P I / i } ) ) . toBeInTheDocument ( ) ;
190- expect ( screen . getByTestId ( "registration- link") ) . toBeInTheDocument ( ) ;
193+ expect ( screen . getByRole ( " link", { name : / r e g i s t e r h e r e ! / i } ) ) . toBeInTheDocument ( ) ;
191194
192195 // Clean up mobile test and set up desktop test
193196 cleanup ( ) ;
@@ -197,7 +200,7 @@ describe("AboutUs Component", () => {
197200
198201 // Verify desktop layout elements
199202 expect ( screen . getByRole ( "heading" , { name : / A b o u t H a c k R P I / i } ) ) . toBeInTheDocument ( ) ;
200- expect ( screen . getByTestId ( "registration- link") ) . toBeInTheDocument ( ) ;
203+ expect ( screen . getByRole ( " link", { name : / r e g i s t e r h e r e ! / i } ) ) . toBeInTheDocument ( ) ;
201204 } ) ;
202205
203206 // 2025 Best Practice: Add automated accessibility testing
0 commit comments