From c0cae269fc2cd10ebb82f552082c2452579e6cac Mon Sep 17 00:00:00 2001 From: Krsiak Daniel Date: Mon, 23 Dec 2024 21:11:07 +0100 Subject: [PATCH] =?UTF-8?q?test(e2e):=20=E2=9C=85=20=20new=20test=20for=20?= =?UTF-8?q?page=20RESUME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - new test - fix url error in page resume --- .../playwright/breadcrumbs/resume.spec.ts | 26 +++++++++++++++++++ app/resume/page.tsx | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 __tests__/playwright/breadcrumbs/resume.spec.ts diff --git a/__tests__/playwright/breadcrumbs/resume.spec.ts b/__tests__/playwright/breadcrumbs/resume.spec.ts new file mode 100644 index 0000000..6338a04 --- /dev/null +++ b/__tests__/playwright/breadcrumbs/resume.spec.ts @@ -0,0 +1,26 @@ +import { getDataTestId } from '@/__tests__/playwright/utils/helpers/getDataTestId' +import { DATA_TEST_IDS } from '@/utils/constants/ids/dataTestIds' +import { PAGES_URL } from '@/utils/constants/urls/pageUrls' +import { expect, test } from '@playwright/test' + +test.describe('Links', () => { + test('should navigate correctly', async ({ page }) => { + await test.step('Go to Resume page', async () => { + await page.goto(PAGES_URL.resume) + }) + + const breadcrumbs = page.locator(getDataTestId(DATA_TEST_IDS.breadcrumbs)) + + await test.step('Check the Home link', async () => { + const homeLink = breadcrumbs.locator('a[href="/"]') + expect(await homeLink.count()).toBe(1) + expect(await homeLink.getAttribute('href')).toBe('/') + }) + + await test.step('Check the Resume link', async () => { + const aboutLink = breadcrumbs.locator(`a[href="${PAGES_URL.resume}"]`) + expect(await aboutLink.count()).toBe(1) + expect(await aboutLink.getAttribute('href')).toBe(PAGES_URL.resume) + }) + }) +}) diff --git a/app/resume/page.tsx b/app/resume/page.tsx index 830235f..ab06de9 100644 --- a/app/resume/page.tsx +++ b/app/resume/page.tsx @@ -61,7 +61,7 @@ const ResumePreviewEmbed = () => { const Resume = () => { return ( - +