Complete Gmail correspondence workflow

This commit is contained in:
2026-04-02 12:29:24 +02:00
parent 1f34eb42d2
commit 5cd34f17bb
10 changed files with 1390 additions and 145 deletions
+33 -22
View File
@@ -35,30 +35,40 @@ function renderPage() {
describe('GmailReviewPage', () => {
beforeEach(() => {
mockedApi.get.mockResolvedValue({
data: {
queries: ['"Acme" "Backend Developer" newer_than:365d'],
candidateThreadCount: 2,
autoLinkThreadCount: 1,
reviewThreadCount: 1,
unmatchedThreadCount: 0,
threads: [
{
threadId: 'thread-1',
subject: 'Backend Developer interview',
latestDate: new Date().toISOString(),
messageCount: 2,
routing: 'review',
hasImportedMessages: false,
matchedQueries: ['"Acme" "Backend Developer" newer_than:365d'],
jobCandidates: [
{ jobApplicationId: 42, jobTitle: 'Backend Developer', companyName: 'Acme', score: 24, confidence: 'medium', reasons: [{ label: 'company', value: 'Acme', points: 18 }] },
mockedApi.get.mockImplementation((url: string) => {
if (url === '/gmail/review-candidates') {
return Promise.resolve({
data: {
queries: ['"Acme" "Backend Developer" newer_than:365d'],
candidateThreadCount: 2,
autoLinkThreadCount: 1,
reviewThreadCount: 1,
unmatchedThreadCount: 0,
threads: [
{
threadId: 'thread-1',
subject: 'Backend Developer interview',
latestDate: new Date().toISOString(),
messageCount: 2,
routing: 'review',
hasImportedMessages: false,
matchedQueries: ['"Acme" "Backend Developer" newer_than:365d'],
jobCandidates: [
{ jobApplicationId: 42, jobTitle: 'Backend Developer', companyName: 'Acme', score: 24, confidence: 'medium', reasons: [{ label: 'company', value: 'Acme', points: 18 }] },
],
messages: [],
},
],
messages: [],
},
],
},
} as any);
} as any);
}
if (url === '/gmail/suggested-jobs') {
return Promise.resolve({ data: { count: 0, items: [] } } as any);
}
return Promise.resolve({ data: {} } as any);
});
});
afterEach(() => {
@@ -88,6 +98,7 @@ describe('GmailReviewPage', () => {
threadId: 'thread-1',
decision: 'linked',
jobApplicationId: 42,
note: null,
});
});
});