mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-14 14:57:00 +10:00
20c803e934
* feat(export): separate resume/cover-letter downloads, redesign dialog, add Markdown Let people export the resume and cover letter as distinct documents, and add a Markdown format alongside PDF / DOCX / JSON (handy for AI agents). - Server/API: scope PDF generation and download URLs to a resume/cover-letter target. - Export domain: getResumeExportData + resumeHasCoverLetter in @reactive-resume/resume. - Redesign the download dialog: one global "What to export" scope toggle (Tabs) plus flattened per-format rows, reusing existing UI components and design language. - Add Markdown export (@reactive-resume/resume/markdown) with a small tiptap-HTML converter. - Fix blank section headings in DOCX and Markdown by injecting the locale-aware section-title resolver (titles are stored empty and resolved at render time). - Locale catalogs updated for the new strings. * test(e2e): open the download dialog before exporting JSON The JSON export moved into the redesigned download dialog, so the spec now opens the dialog from the Export sidebar section before clicking "Download JSON".
32 lines
1.5 KiB
TypeScript
32 lines
1.5 KiB
TypeScript
import { readFile } from "node:fs/promises";
|
|
import { createSampleResumeFromDashboard, openSidebarSection } from "../fixtures/resume";
|
|
import { expect, test } from "../fixtures/test";
|
|
|
|
test("exports and imports a resume JSON backup", async ({ authPage: page }, testInfo) => {
|
|
await createSampleResumeFromDashboard(page, testInfo);
|
|
|
|
await openSidebarSection(page, "Export");
|
|
|
|
// Downloads now live in a dialog: open it, then trigger the JSON export.
|
|
await page.getByRole("button", { name: /Choose PDF, DOCX, or JSON/ }).click();
|
|
const downloadPromise = page.waitForEvent("download");
|
|
await page.getByRole("button", { name: "Download JSON" }).click();
|
|
const download = await downloadPromise;
|
|
expect(download.suggestedFilename()).toMatch(/\.json$/);
|
|
|
|
const downloadPath = testInfo.outputPath(download.suggestedFilename());
|
|
await download.saveAs(downloadPath);
|
|
const exportedData = JSON.parse(await readFile(downloadPath, "utf-8")) as { basics: { name: string } };
|
|
|
|
await page.goto("/dashboard/resumes");
|
|
await page.getByRole("button", { name: "Import", exact: true }).click();
|
|
const dialog = page.getByRole("dialog", { name: "Import an existing resume" });
|
|
// Import is now file-first: selecting the file auto-detects the Reactive Resume JSON format.
|
|
await dialog.locator('input[type="file"]').setInputFiles(downloadPath);
|
|
await dialog.getByRole("button", { name: "Import", exact: true }).click();
|
|
|
|
await page.waitForURL(/\/builder\/.+/);
|
|
await openSidebarSection(page, "Basics");
|
|
await expect(page.getByLabel("Name")).toHaveValue(exportedData.basics.name);
|
|
});
|