feat(cv): rebuild professional resume studio
This commit is contained in:
@@ -128,6 +128,36 @@ test('failed autosave is visible and can be retried with the latest data', async
|
||||
}));
|
||||
});
|
||||
|
||||
test('session undo and redo restore content edits before autosave', async () => {
|
||||
routeGet(() => Promise.resolve({ data: variant } as any));
|
||||
mockedApi.put.mockResolvedValue({ data: variant } as any);
|
||||
renderAt(3);
|
||||
|
||||
const headline = await screen.findByLabelText('Headline override');
|
||||
fireEvent.change(headline, { target: { value: 'Platform Engineer' } });
|
||||
expect(screen.getByRole('button', { name: 'Undo' })).toBeEnabled();
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Undo' }));
|
||||
expect(headline).toHaveValue('');
|
||||
expect(screen.getByRole('button', { name: 'Redo' })).toBeEnabled();
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Redo' }));
|
||||
expect(headline).toHaveValue('Platform Engineer');
|
||||
});
|
||||
|
||||
test('professional editor separates template, design and layout controls', async () => {
|
||||
routeGet(() => Promise.resolve({ data: variant } as any));
|
||||
renderAt(3);
|
||||
|
||||
await screen.findByLabelText('Headline override');
|
||||
fireEvent.click(screen.getByRole('tab', { name: 'Design' }));
|
||||
expect(screen.getByText('Typography')).toBeInTheDocument();
|
||||
expect(screen.getByLabelText('Body size')).toBeInTheDocument();
|
||||
expect(screen.getByLabelText('Skills presentation')).toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole('tab', { name: 'Layout' }));
|
||||
expect(screen.getByLabelText('Page size')).toBeInTheDocument();
|
||||
expect(screen.getByLabelText('Columns')).toBeInTheDocument();
|
||||
expect(screen.getByLabelText('Language')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('internal navigation warns and can be cancelled before discarding a pending edit', async () => {
|
||||
routeGet(() => Promise.resolve({ data: variant } as any));
|
||||
renderAt(3);
|
||||
@@ -137,7 +167,7 @@ test('internal navigation warns and can be cancelled before discarding a pending
|
||||
const dialog = await screen.findByRole('dialog', { name: 'Discard unsaved CV changes?' });
|
||||
expect(within(dialog).getByText('This CV has unsaved changes. Leave and discard them?')).toBeInTheDocument();
|
||||
fireEvent.click(within(dialog).getByRole('button', { name: 'Cancel' }));
|
||||
await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument(), { timeout: 5000 });
|
||||
expect(screen.getByDisplayValue('Backend CV')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user