Skip to content

Commit

Permalink
test(e2e): ✅ new test for page RESUME
Browse files Browse the repository at this point in the history
- new test
- fix url error in page resume
  • Loading branch information
krsiakdaniel committed Dec 23, 2024
1 parent a8783d1 commit c0cae26
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions __tests__/playwright/breadcrumbs/resume.spec.ts
Original file line number Diff line number Diff line change
@@ -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)
})
})
})
2 changes: 1 addition & 1 deletion app/resume/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const ResumePreviewEmbed = () => {
const Resume = () => {
return (
<PageContainer id={ID.about}>
<BreadCrumbs linkLevel1={PAGES_URL.aboutMe} textLevel1={TEXT.resume} />
<BreadCrumbs linkLevel1={PAGES_URL.resume} textLevel1={TEXT.resume} />
<div>
<ResumeInfo />
<div className="mt-8">
Expand Down

0 comments on commit c0cae26

Please sign in to comment.