@@ -58,11 +58,13 @@ describe('Footer Component', () => {
5858 it ( 'renders Discord community link' , ( ) => {
5959 render ( < Footer /> ) ;
6060
61- const discordLink = screen . getByRole ( 'link' , {
62- name : / D i s c o r d / i,
61+ // Discord now appears twice: once in the Connect column (text + icon) and once in the bottom bar icon strip.
62+ const discordLinks = screen . getAllByRole ( 'link' , {
63+ name : / J o i n C o m m i t P u l s e o n D i s c o r d / i,
6364 } ) ;
6465
65- expect ( discordLink ) . toHaveAttribute ( 'href' , 'https://discord.gg/f84SDraEBH' ) ;
66+ expect ( discordLinks . length ) . toBeGreaterThanOrEqual ( 1 ) ;
67+ expect ( discordLinks [ 0 ] ) . toHaveAttribute ( 'href' , 'https://discord.gg/f84SDraEBH' ) ;
6668 } ) ;
6769
6870 it ( 'exposes the footer as a semantic contentinfo landmark for screen readers' , ( ) => {
@@ -114,10 +116,14 @@ describe('Footer Component', () => {
114116 const connectHeading = screen . getByRole ( 'heading' , { name : / C o n n e c t / i } ) ;
115117 expect ( connectHeading ) . toBeInTheDocument ( ) ;
116118
117- // Check for social links
118- expect ( screen . getByRole ( 'link' , { name : / C r e a t o r o n X / i } ) ) . toBeInTheDocument ( ) ;
119- expect ( screen . getByRole ( 'link' , { name : / L i n k e d I n / i } ) ) . toBeInTheDocument ( ) ;
120- expect ( screen . getByRole ( 'link' , { name : / D i s c o r d / i } ) ) . toBeInTheDocument ( ) ;
119+ // Social links now appear twice (Connect column + bottom bar icon strip); use getAllByRole.
120+ expect ( screen . getAllByRole ( 'link' , { name : / C r e a t o r o n X / i } ) . length ) . toBeGreaterThanOrEqual ( 1 ) ;
121+ expect (
122+ screen . getAllByRole ( 'link' , { name : / C r e a t o r o n L i n k e d I n / i } ) . length
123+ ) . toBeGreaterThanOrEqual ( 1 ) ;
124+ expect (
125+ screen . getAllByRole ( 'link' , { name : / J o i n C o m m i t P u l s e o n D i s c o r d / i } ) . length
126+ ) . toBeGreaterThanOrEqual ( 1 ) ;
121127 } ) ;
122128
123129 it ( 'has proper responsive layout classes' , ( ) => {
@@ -159,4 +165,21 @@ describe('Footer Component', () => {
159165 expect ( link . className ) . toContain ( 'focus:ring' ) ;
160166 } ) ;
161167 } ) ;
168+
169+ it ( 'renders social icon strip in the bottom bar with correct links and no duplicate creator icon' , ( ) => {
170+ render ( < Footer /> ) ;
171+
172+ // Project GitHub, Discord, X, LinkedIn each appear twice:
173+ // once in the Connect column (with text label) and once in the bottom bar icon strip.
174+ expect ( screen . getAllByRole ( 'link' , { name : 'CommitPulse on GitHub' } ) ) . toHaveLength ( 2 ) ;
175+ expect ( screen . getAllByRole ( 'link' , { name : 'Join CommitPulse on Discord' } ) ) . toHaveLength ( 2 ) ;
176+ expect ( screen . getAllByRole ( 'link' , { name : 'Creator on X' } ) ) . toHaveLength ( 2 ) ;
177+ expect ( screen . getAllByRole ( 'link' , { name : 'Creator on LinkedIn' } ) ) . toHaveLength ( 2 ) ;
178+
179+ // The creator's personal GitHub link must appear only once (Connect column only, not in bottom bar).
180+ expect ( screen . getAllByRole ( 'link' , { name : 'Creator Sourav Jha on GitHub' } ) ) . toHaveLength ( 1 ) ;
181+
182+ // The bottom bar nav landmark must be present with an accessible label.
183+ expect ( screen . getByRole ( 'navigation' , { name : 'Social media links' } ) ) . toBeInTheDocument ( ) ;
184+ } ) ;
162185} ) ;
0 commit comments