diff --git a/apps/website/e2e/careers.spec.ts b/apps/website/e2e/careers.spec.ts index ae98056dde..22263c1bfc 100644 --- a/apps/website/e2e/careers.spec.ts +++ b/apps/website/e2e/careers.spec.ts @@ -23,15 +23,6 @@ test.describe('Careers page @smoke', () => { expect(await roles.count()).toBeGreaterThan(0) }) - test('each role links to jobs.ashbyhq.com', async ({ page }) => { - const roles = page.getByTestId('careers-role-link') - const count = await roles.count() - for (let i = 0; i < count; i++) { - const href = await roles.nth(i).getAttribute('href') - expect(href).toMatch(/^https:\/\/jobs\.ashbyhq\.com\//) - } - }) - test('clicking a department button scrolls to and activates that section', async ({ page }) => { @@ -63,6 +54,21 @@ test.describe('Careers page @smoke', () => { }) }) +test.describe('Careers page role links', () => { + test('each role links to the Ashby job description page, not the application form', async ({ + page + }) => { + await page.goto('/careers') + const roles = page.getByTestId('careers-role-link') + const count = await roles.count() + for (let i = 0; i < count; i++) { + const href = await roles.nth(i).getAttribute('href') + expect(href).toMatch(/^https:\/\/jobs\.ashbyhq\.com\//) + expect(href).not.toMatch(/\/application\/?$/) + } + }) +}) + test.describe('Careers page (zh-CN) @smoke', () => { test('renders localized heading and roles', async ({ page }) => { await page.goto('/zh-CN/careers') diff --git a/apps/website/src/components/careers/RolesSection.vue b/apps/website/src/components/careers/RolesSection.vue index eee25b81fb..f57a400f02 100644 --- a/apps/website/src/components/careers/RolesSection.vue +++ b/apps/website/src/components/careers/RolesSection.vue @@ -130,7 +130,7 @@ function scrollToDepartment(deptKey: string) { { if (outcome.status !== 'fresh') return expect(outcome.droppedCount).toBe(0) expect(outcome.snapshot.departments).toHaveLength(1) - expect(outcome.snapshot.departments[0]!.roles[0]!.applyUrl).toMatch( - /design-engineer\/apply$/ - ) - }) - - it('falls back to jobUrl when applyUrl is missing and keeps the role', async () => { - const job = validJob() - delete (job as Record).applyUrl - const fetchImpl = vi.fn(async () => - response({ apiVersion: '1', jobs: [job] }) - ) - const outcome = await fetchRolesForBuild({ - apiKey: KEY, - boardName: BOARD, - baseUrl: BASE_URL, - fetchImpl: fetchImpl as unknown as typeof fetch - }) - expect(outcome.status).toBe('fresh') - if (outcome.status !== 'fresh') return - expect(outcome.snapshot.departments[0]!.roles[0]!.applyUrl).toBe( + expect(outcome.snapshot.departments[0]!.roles[0]!.jobUrl).toBe( 'https://jobs.ashbyhq.com/comfy-org/design-engineer' ) }) diff --git a/apps/website/src/utils/ashby.ts b/apps/website/src/utils/ashby.ts index c863172db2..6402a80bec 100644 --- a/apps/website/src/utils/ashby.ts +++ b/apps/website/src/utils/ashby.ts @@ -243,13 +243,13 @@ function groupByDepartment(jobs: readonly AshbyJobPosting[]): Department[] { } function toDomainRole(job: AshbyJobPosting, department: string): Role { - const applyUrl = job.applyUrl ?? job.jobUrl + const jobUrl = job.jobUrl return { - id: createHash('sha1').update(applyUrl).digest('hex').slice(0, 16), + id: createHash('sha1').update(jobUrl).digest('hex').slice(0, 16), title: job.title, department: capitalize(department), location: (job.location ?? '').trim() || DEFAULT_LOCATION, - applyUrl + jobUrl } }