feat(cv): redesign document editing with revision-safe letters and writing tools
This commit is contained in:
@@ -61,6 +61,23 @@ beforeEach(() => {
|
||||
|
||||
afterEach(() => window.localStorage.removeItem("uiLanguage"));
|
||||
|
||||
test.each([['Improve writing', 'improve'], ['Suggest content', 'suggest'], ['Grammar check', 'grammar'], ['Shorter', 'shorten']])(
|
||||
'direct %s action retains explicit review', async (label, action) => {
|
||||
const { onGenerate, onAccept } = renderAssistant();
|
||||
fireEvent.click(screen.getByRole('button', { name: label }));
|
||||
await waitFor(() => expect(onGenerate).toHaveBeenCalledWith(expect.objectContaining({ action, language: 'nb-NO' })));
|
||||
expect(await screen.findByDisplayValue('Proposed wording')).toBeInTheDocument();
|
||||
expect(onAccept).not.toHaveBeenCalled();
|
||||
},
|
||||
);
|
||||
|
||||
test('empty source requests career facts without making an AI request', () => {
|
||||
const { onGenerate } = renderAssistant({ text: '' });
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Suggest content' }));
|
||||
expect(screen.getByText(/Add verified career facts/)).toBeInTheDocument();
|
||||
expect(onGenerate).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test("section AI uses the CV document language and requires explicit server acceptance", async () => {
|
||||
const generated = proposal("Utviklet driftssikre API-er");
|
||||
const { onGenerate, onAccept } = renderAssistant({ onGenerate: jest.fn().mockResolvedValue(generated) });
|
||||
|
||||
Reference in New Issue
Block a user