@@ -5,23 +5,19 @@ test.beforeEach(async ({ page }) => {
55} ) ;
66
77test . describe ( 'Test Hero Header Navigation Links' , ( ) => {
8- test ( 'About us link should navigate to about us section' , async ( {
9- page,
10- } ) => {
11- await page . getByRole ( 'link' , { name : 'About us' } ) . click ( ) ;
12- await expect ( page ) . toHaveURL ( '/#about-us' ) ;
8+ test ( 'About us link should navigate to about us page' , async ( { page } ) => {
9+ await page . getByRole ( 'link' , { name : 'About Us' } ) . click ( ) ;
10+ await expect ( page ) . toHaveURL ( '/about' ) ;
1311 } ) ;
1412
15- test ( 'Events link should navigate to Events section ' , async ( { page } ) => {
16- await page . getByRole ( 'link' , { name : 'Events' , exact : true } ) . click ( ) ;
17- await expect ( page ) . toHaveURL ( '/# events' ) ;
13+ test ( 'Events link should navigate to Events page ' , async ( { page } ) => {
14+ await page . getByRole ( 'link' , { name : 'Workshops & Events' } ) . click ( ) ;
15+ await expect ( page ) . toHaveURL ( '/events' ) ;
1816 } ) ;
1917
20- test ( 'Contact link should navigate to Contact Us section' , async ( {
21- page,
22- } ) => {
23- await page . getByRole ( 'link' , { name : 'Contact' } ) . click ( ) ;
24- await expect ( page ) . toHaveURL ( '/#contact-us' ) ;
18+ test ( 'Community link should navigate to Community page' , async ( { page } ) => {
19+ await page . getByRole ( 'link' , { name : 'Community' , exact : true } ) . click ( ) ;
20+ await expect ( page ) . toHaveURL ( '/community' ) ;
2521 } ) ;
2622
2723 test ( 'Join Community link should open google form in new tab' , async ( {
@@ -31,11 +27,11 @@ test.describe('Test Hero Header Navigation Links', () => {
3127 const [ newPage ] = await Promise . all ( [
3228 context . waitForEvent ( 'page' ) ,
3329 page . waitForLoadState ( ) ,
34- page . getByRole ( 'link' , { name : 'Join Community' } ) . click ( ) ,
30+ page . getByRole ( 'link' , { name : 'Join the Community' } ) . click ( ) ,
3531 ] ) ;
3632 await newPage . waitForLoadState ( 'load' ) ;
37- // Accept either the shortlink (bit.ly) or the final Google Forms URL
38- expect ( newPage . url ( ) ) . toMatch ( / ^ ( h t t p s : \/ \/ ) ? ( b i t \. l y | d o c s \. g o o g l e \. c o m ) / ) ;
33+ // Accept bit.ly shortlink, docs.google.com, or forms.gle redirect destinations
34+ expect ( newPage . url ( ) ) . toMatch ( / ^ ( h t t p s : \/ \/ ) ? ( b i t \. l y | d o c s \. g o o g l e \. c o m | f o r m s \. g l e ) / ) ;
3935 } ) ;
4036
4137 test ( 'Join ReactDevsKe link should open google form in new tab' , async ( {
@@ -48,7 +44,7 @@ test.describe('Test Hero Header Navigation Links', () => {
4844 page . getByRole ( 'link' , { name : 'Join ReactDevsKe' } ) . click ( ) ,
4945 ] ) ;
5046 await newPage . waitForLoadState ( 'load' ) ;
51- // Accept either the shortlink (bit.ly) or the final Google Forms URL
52- expect ( newPage . url ( ) ) . toMatch ( / ^ ( h t t p s : \/ \/ ) ? ( b i t \. l y | d o c s \. g o o g l e \. c o m ) / ) ;
47+ // Accept bit.ly shortlink, docs.google.com, or forms.gle redirect destinations
48+ expect ( newPage . url ( ) ) . toMatch ( / ^ ( h t t p s : \/ \/ ) ? ( b i t \. l y | d o c s \. g o o g l e \. c o m | f o r m s \. g l e ) / ) ;
5349 } ) ;
5450} ) ;
0 commit comments