feat(cv): redesign document editing with revision-safe letters and writing tools

This commit is contained in:
cesnimda
2026-10-25 22:44:14 +01:00
parent 01e10996c5
commit 2bfaf6c14b
57 changed files with 2859 additions and 118 deletions
+3 -1
View File
@@ -81,6 +81,7 @@ for (const [mode, language] of [['light', 'en'], ['dark', 'nb'], ['light', 'nb']
const move = page.getByRole('button', { name: label('cvEditorMoveSectionDown', t.cvSectionExperience), exact: true });
await move.focus(); await page.keyboard.press('Enter');
await expect(move).toBeFocused(); await saved();
await expect(page.getByRole('status').filter({ hasText: t.cvEditorReordered.replace('{item}', t.cvSectionExperience).replace('{position}', '4').replace('{total}', '13') })).toBeVisible();
expect((await read()).settings.sections.slice(0, 4).map((row: { key: string }) => row.key)).toEqual(['summary', 'projects', 'education', 'experience']);
await capture(page, info, 'reordered-section-focus');
@@ -137,7 +138,7 @@ for (const [mode, language] of [['light', 'en'], ['dark', 'nb'], ['light', 'nb']
await page.getByRole('menuitem', { name: t.cvEditorStopSharing, exact: true }).click();
await expect(page.getByText(t.cvEditorShared, { exact: true })).toHaveCount(0);
expect((await anonymous.get(`${apiUrl}/public-cv/${publicCv.publicSlug}`)).status()).toBe(404); await anonymous.dispose();
const pdfResponse = page.waitForResponse(response => response.url() === `${cvUrl}/export-pdf` && response.request().method() === 'POST');
const pdfResponse = page.waitForResponse(response => new URL(response.url()).pathname === new URL(`${cvUrl}/export-pdf`).pathname && new URL(response.url()).searchParams.has('expectedVersion') && response.request().method() === 'POST');
const download = page.waitForEvent('download');
await page.getByRole('button', { name: t.cvEditorDownloadPdf, exact: true }).click();
expect((await pdfResponse).status()).toBe(200); expect((await download).suggestedFilename()).toMatch(/\.pdf$/i);
@@ -145,6 +146,7 @@ for (const [mode, language] of [['light', 'en'], ['dark', 'nb'], ['light', 'nb']
await page.setViewportSize({ width: 1440, height: 900 });
await page.getByRole('tab', { name: t.cvEditorHistory, exact: true }).click();
const history = page.getByRole('tabpanel', { name: t.cvEditorHistory, exact: true });
await expect(history.getByText(t.cvEditorHistoryScope, { exact: true })).toBeVisible();
await expect(history.getByText(t.cvEditorVersion.replace('{version}', '1'), { exact: true })).toBeVisible();
await capture(page, info, 'history'); await scan(page, info, 'history');
await page.getByRole('tab', { name: t.cvEditorAiTools, exact: true }).click();