Files
Reactive-Resume/tests/e2e/specs/dashboard-lifecycle.spec.ts
T
Amruth Pillai 0ba44865c7 test: add e2e specs for dashboard, sections, templates, sharing and settings workflows
- dashboard-lifecycle: rename, duplicate, delete via card context menu
- section-editing: add experience item, verify persistence across reloads
- template-switch: switch template in gallery, verify persisted selection
- sharing-password: password-protect public link, unlock as anonymous visitor
- lock-resume: lock blocks update/delete, unlock restores them
- settings-profile: profile name change persists
2026-07-03 20:04:36 +02:00

31 lines
1.7 KiB
TypeScript

import { createSampleResumeFromDashboard, openResumeCardMenu } from "../fixtures/resume";
import { expect, test } from "../fixtures/test";
test("renames, duplicates and deletes a resume from the dashboard", async ({ authPage: page }, testInfo) => {
const resumeName = await createSampleResumeFromDashboard(page, testInfo);
// Rename via the card context menu (resume names are capped at 64 chars, keep it short)
const renamedTo = `E2E Renamed ${Date.now().toString(36)}`;
await openResumeCardMenu(page, resumeName);
await page.getByRole("menuitem", { name: "Update" }).click();
const updateDialog = page.getByRole("dialog", { name: "Update Resume" });
await updateDialog.getByLabel("Name").fill(renamedTo);
await updateDialog.getByRole("button", { name: "Save Changes" }).click();
await expect(page.getByRole("link", { name: new RegExp(renamedTo) })).toBeVisible();
// Duplicate — the copy defaults to "<name> (Copy)"
await openResumeCardMenu(page, renamedTo);
await page.getByRole("menuitem", { name: "Duplicate" }).click();
const duplicateDialog = page.getByRole("dialog", { name: "Duplicate Resume" });
await duplicateDialog.getByRole("button", { name: "Duplicate" }).click();
const copyLink = page.getByRole("link", { name: new RegExp(`${renamedTo} \\(Copy\\)`) });
await expect(copyLink).toBeVisible();
// Delete the copy and verify it disappears while the original stays
await openResumeCardMenu(page, `${renamedTo} \\(Copy\\)`);
await page.getByRole("menuitem", { name: "Delete" }).click();
await page.getByRole("alertdialog").getByRole("button", { name: "Confirm" }).click();
await expect(copyLink).toBeHidden();
await expect(page.getByRole("link", { name: new RegExp(renamedTo) })).toBeVisible();
});