test(cv): select explicit profile content in legacy smoke flows
This commit is contained in:
@@ -331,6 +331,11 @@ test("the dedicated application workspace survives deep links, long data and uns
|
||||
|
||||
test("Career Workspace loads from the authenticated application shell", async ({ page }) => {
|
||||
await login(page);
|
||||
const headers = await csrfHeader(page);
|
||||
const source = await (await page.request.get(`${apiUrl}/career/profile`)).json();
|
||||
expect((await page.request.put(`${apiUrl}/career/profile`, { headers, data: { expectedVersion: source.revision,
|
||||
profile: { version: "1", contact: { fullName: "Fictional Career Workspace Candidate" }, summary: ["Synthetic professional summary."],
|
||||
jobs: [{ title: "Engineer", company: "Fictional workspace company", bullets: ["Maintained a synthetic software service."] }] } } })).status()).toBe(200);
|
||||
await page.evaluate(() => window.localStorage.setItem("jobtracker.themeMode", "light"));
|
||||
await page.goto("/career");
|
||||
await expect(page.getByRole("heading", { name: "Career Workspace" })).toBeVisible();
|
||||
@@ -359,8 +364,16 @@ test("Career Workspace loads from the authenticated application shell", async ({
|
||||
await page.getByRole("link", { name: "Open CV Builder" }).click();
|
||||
await expect(page).toHaveURL(/\/career\/builder$/);
|
||||
await page.getByRole("button", { name: "New CV" }).first().click();
|
||||
await expect(page.getByRole("dialog", { name: "Create a CV" })).toBeVisible();
|
||||
await page.getByRole("button", { name: "Create CV" }).click();
|
||||
const createDialog = page.getByRole("dialog", { name: "Create a CV" });
|
||||
await expect(createDialog).toBeVisible();
|
||||
await createDialog.getByRole("radio", { name: "From Career Profile", exact: true }).check();
|
||||
await createDialog.getByRole("checkbox", { name: "Professional Summary", exact: true }).check();
|
||||
await createDialog.getByRole("checkbox", { name: "Professional Experience", exact: true }).check();
|
||||
const createdResponse = page.waitForResponse(response => response.url() === `${apiUrl}/cv/variants` && response.request().method() === "POST");
|
||||
await createDialog.getByRole("button", { name: "Create CV" }).click();
|
||||
const created = await (await createdResponse).json();
|
||||
expect(created.settings.sectionsExplicit).toBe(true);
|
||||
expect(created.settings.sections.map((section: { key: string }) => section.key)).toEqual(["summary", "experience"]);
|
||||
await expect(page).toHaveURL(/\/career\/builder\/\d+$/);
|
||||
await expect(page.getByLabel("CV name")).toBeVisible();
|
||||
|
||||
@@ -372,7 +385,7 @@ test("Career Workspace loads from the authenticated application shell", async ({
|
||||
|
||||
await page.getByRole("button", { name: "Add content" }).click();
|
||||
const addContentDialog = page.getByRole("dialog", { name: "Add content" });
|
||||
const additionalExperienceCard = addContentDialog.getByRole("heading", { name: "Additional Experience" }).locator("..");
|
||||
const additionalExperienceCard = addContentDialog.getByText("Add a structured Additional Experience section with reorderable entries.", { exact: true }).locator("..");
|
||||
await additionalExperienceCard.getByRole("button", { name: "Add", exact: true }).click();
|
||||
await page.getByRole("button", { name: "Expand Additional Experience" }).click();
|
||||
await page.getByRole("button", { name: "Add entry" }).click();
|
||||
@@ -546,7 +559,8 @@ test("the Code template exports a long structured CV as searchable multi-page PD
|
||||
await addContentButton.click();
|
||||
const addContentDialog = page.getByRole("dialog", { name: "Add content" });
|
||||
await expect(addContentDialog).toBeVisible();
|
||||
await expect(addContentDialog.getByRole("heading", { name: "Additional Experience" })).toBeVisible();
|
||||
const customExperienceCard = addContentDialog.getByText("Add a structured Additional Experience section with reorderable entries.", { exact: true }).locator("..");
|
||||
await expect(customExperienceCard.getByRole("heading", { name: "Additional Experience", exact: true })).toBeVisible();
|
||||
await addContentDialog.getByRole("button", { name: "Cancel" }).click();
|
||||
await expect(addContentDialog).toBeHidden();
|
||||
await expect(addContentButton).toBeFocused();
|
||||
|
||||
Reference in New Issue
Block a user