Skip to content

Commit

Permalink
Merge pull request kodadot#7893 from prury/footer-regex
Browse files Browse the repository at this point in the history
Test: Mitigate redirection when testing footer links
  • Loading branch information
roiLeo authored Oct 31, 2023
2 parents c464504 + dfcb479 commit 1e5dff4
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/e2e/footer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,31 @@ const footerLinks = [
const footerSocialMediaLinks = [
{
linkName: 'Twitter',
linkAddress: 'https://twitter.com/KodaDot',
linkAddress: 'KodaDot',
},
{
linkName: 'Beehiiv',
linkAddress: 'https://kodadotweeklyroundup.beehiiv.com',
linkAddress: 'kodadotweeklyroundup',
},
{
linkName: 'Linkedin',
linkAddress: 'https://www.linkedin.com/company/kodadot',
linkAddress: '/company/kodadot',
},
{
linkName: 'Medium',
linkAddress: 'blog.kodadot.xyz',
},
//{
// linkName: 'Medium',
// linkAddress: 'https://medium.com/kodadot',
//},
{
linkName: 'Youtube',
linkAddress: 'https://www.youtube.com/channel/UCEULduld5NrqOL49k1KVjoA/',
linkAddress: 'UCEULduld5NrqOL49k1KVjoA',
},
{
linkName: 'Instagram',
linkAddress: 'kodadot.xyz',
},
// {
// linkName: 'Instagram',
// linkAddress: 'https://www.instagram.com/kodadot.xyz/',
// },
{
linkName: 'Reddit',
linkAddress: 'https://www.reddit.com/r/KodaDot/',
linkAddress: '/r/KodaDot/',
},
]

Expand Down Expand Up @@ -112,7 +112,7 @@ test('Check Social Media Links', async ({ page }) => {
const newTabPromise = page.waitForEvent('popup')
await socialMedia.locator(`[aria-label="${data.linkName}"]`).click()
const newTab = await newTabPromise
await expect(newTab).toHaveURL(data.linkAddress)
await expect(newTab).toHaveURL(new RegExp(`${data.linkAddress}`))
await newTab.close()
}
})

0 comments on commit 1e5dff4

Please sign in to comment.