diff --git a/__tests__/playwright/hero.spec.ts b/__tests__/playwright/hero.spec.ts index 8b95c322..868ca894 100644 --- a/__tests__/playwright/hero.spec.ts +++ b/__tests__/playwright/hero.spec.ts @@ -1,6 +1,6 @@ import { Browser, BrowserContext, Page, chromium, expect, test } from '@playwright/test' -import { LINK_GITHUB, LINK_LINKEDIN, LINK_RESUME } from '@/utils/constants' +import { EMAIL_HREF, LINK_GITHUB, LINK_LINKEDIN, LINK_RESUME, PHONE_HREF } from '@/utils/constants' let browser: Browser let context: BrowserContext @@ -58,3 +58,17 @@ test.describe('Hero - Links', () => { expect(resumeLink).toBe(LINK_RESUME) }) }) + +test.describe('Hero - Email & Phone', () => { + test('should have the correct Email link', async () => { + await page.goto('http://localhost:3000') // replace with your app's url + const emailLink = await page.getAttribute('[data-testid="hero-link-email"]', 'href') + expect(emailLink).toBe(EMAIL_HREF) + }) + + test('should have the correct Phone link', async () => { + await page.goto('http://localhost:3000') // replace with your app's url + const phoneLink = await page.getAttribute('[data-testid="hero-link-phone"]', 'href') + expect(phoneLink).toBe(PHONE_HREF) + }) +}) diff --git a/components/Hero.tsx b/components/Hero.tsx index 9ce940ef..0597ba78 100644 --- a/components/Hero.tsx +++ b/components/Hero.tsx @@ -64,12 +64,14 @@ const Hero = () => {