test(ui): stabilize slow suites and repair stale trust-loop mocks
- Raise testing-library asyncUtilTimeout to 4s and jest timeout to 30s: heavy MUI views exceeded the 1s default on slower machines (profile-page, daily-control-loop double-mount). - end-to-end-trust-loop: mock the /tailored-cv-draft endpoint the redesigned Tailored CV tab now loads, and assert on the structured draft instead of the removed legacy tailoredCvText textarea. Full suite now green locally: 18/18 suites, 39/39 tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -110,6 +110,20 @@ describe('end-to-end trust loop', () => {
|
||||
if (url === '/jobapplications/42') return Promise.resolve({ data: jobRecord } as any);
|
||||
if (url === '/auth/me') return Promise.resolve({ data: { roles: [], profileCvText: 'Master CV text' } } as any);
|
||||
if (url === '/jobapplications/42/history') return Promise.resolve({ data: [] } as any);
|
||||
if (url === '/jobapplications/42/tailored-cv-draft') {
|
||||
return Promise.resolve({
|
||||
data: {
|
||||
templateId: 'ats-minimal',
|
||||
headline: 'Backend Developer',
|
||||
summary: ['Tailored for the Acme backend role'],
|
||||
selectedSkills: [],
|
||||
experience: [],
|
||||
education: [],
|
||||
customSections: [],
|
||||
status: 'saved',
|
||||
},
|
||||
} as any);
|
||||
}
|
||||
if (url === '/attachments/42') return Promise.resolve({ data: [{ id: 9, fileName: 'resume.pdf', uploadDate: new Date().toISOString(), fileType: 'application/pdf', fileSize: 1234, purpose: 'resume', useForAi: true }] } as any);
|
||||
if (url === '/correspondence/42') return Promise.resolve({ data: correspondenceMessages } as any);
|
||||
if (url === '/gmail/status') return Promise.resolve({ data: { connected: true, gmailAddress: 'user@example.test', lastSyncedAt: new Date().toISOString() } } as any);
|
||||
@@ -207,7 +221,7 @@ describe('end-to-end trust loop', () => {
|
||||
|
||||
fireEvent.click(screen.getByRole('tab', { name: /tailored cv/i }));
|
||||
|
||||
expect(await screen.findByDisplayValue('Saved CV')).toBeInTheDocument();
|
||||
expect((await screen.findAllByDisplayValue(/tailored for the acme backend role/i)).length).toBeGreaterThan(0);
|
||||
expect(await screen.findByDisplayValue('Saved cover letter')).toBeInTheDocument();
|
||||
expect(await screen.findByDisplayValue('Saved application answer')).toBeInTheDocument();
|
||||
expect(await screen.findByDisplayValue('Saved recruiter message')).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user