feat(jobs): expose discovery provenance
CI and Deploy / test (pull_request) Successful in 4m15s
CI and Deploy / deploy (pull_request) Has been skipped

This commit is contained in:
cesnimda
2026-08-10 10:38:01 +02:00
parent 986f58522b
commit 511a9f6795
5 changed files with 58 additions and 9 deletions
+3 -2
View File
@@ -72,7 +72,7 @@ test('does not auto-import when no initialUrl is given', async () => {
test('can generate a tailored CV after creating a job', async () => {
mockedApi.post.mockImplementation((url: string) => {
if (url === '/jobimport/preview') return Promise.resolve({ data: { success: true, title: 'Imported Backend Role', company: 'Acme', description: 'desc' } } as any);
if (url === '/jobimport/preview') return Promise.resolve({ data: { success: true, title: 'Imported Backend Role', company: 'Acme', description: 'desc', source: 'nav', countryCode: 'NO' } } as any);
if (url === '/companies') return Promise.resolve({ data: { id: 1, name: 'Acme' } } as any);
if (url === '/jobapplications') return Promise.resolve({ data: { id: 42 } } as any);
return Promise.resolve({ data: {} } as any);
@@ -85,5 +85,6 @@ test('can generate a tailored CV after creating a job', async () => {
for (let step = 0; step < 3; step += 1) fireEvent.click(screen.getByRole('button', { name: 'Skip and continue' }));
fireEvent.click(screen.getByRole('button', { name: /create job/i }));
await waitFor(() => expect(mockedApi.post).toHaveBeenCalledWith('/jobapplications/42/generate-tailored-cv-draft'));
await waitFor(() => expect(mockedApi.post).toHaveBeenCalledWith('/jobapplications', expect.objectContaining({ source: 'nav', countryCode: 'NO' })));
expect(mockedApi.post).toHaveBeenCalledWith('/jobapplications/42/generate-tailored-cv-draft');
});