test(qa): verify exact long timeline content preservation

This commit is contained in:
cesnimda
2026-10-23 02:57:04 +02:00
parent d518d471f9
commit a4cf429fb3
4 changed files with 11 additions and 8 deletions
@@ -55,14 +55,15 @@ test('P9 volume: 100 manual timeline messages retain exact membership and foreig
expect(company.status()).toBe(201);
const job = await api.post(`${base}/jobapplications`, { headers, data: { companyId: (await company.json()).id, jobTitle: 'Volume timeline fixture', status: 'Saved' } });
expect(job.status()).toBe(201); const jobId = (await job.json()).id;
const ids: number[] = [];
const ids: number[] = []; const expectedContent = new Map<number, string>();
for (let index = 0; index < 100; index++) {
const response = await api.post(`${base}/correspondence`, { headers, data: { jobApplicationId: jobId, from: 'Synthetic manual note', content: `Timeline evidence ${index} ${'Documented progress. '.repeat(20)}`, channel: 'manual', direction: 'incoming' } });
expect(response.status()).toBe(201); ids.push((await response.json()).id);
const content = `Timeline evidence ${index} ${'Documented progress. '.repeat(20)}`.trimEnd();
const response = await api.post(`${base}/correspondence`, { headers, data: { jobApplicationId: jobId, from: 'Synthetic manual note', content, channel: 'manual', direction: 'incoming' } });
expect(response.status()).toBe(201); const id = (await response.json()).id; ids.push(id); expectedContent.set(id, content);
}
const response = await api.get(`${base}/correspondence/${jobId}`); expect(response.status()).toBe(200);
const rows = await response.json(); expect(rows.map((row: { id: number }) => row.id).sort((a: number, b: number) => a - b)).toEqual([...ids].sort((a, b) => a - b));
expect(rows.every((row: { content: string }) => row.content.startsWith('Timeline evidence '))).toBe(true);
for (const row of rows) expect(row.content).toBe(expectedContent.get(row.id));
expect((await other.api.get(`${base}/correspondence/${jobId}`)).status()).toBe(404);
await info.attach('phase9-volume-timeline', { body: JSON.stringify({ messages: rows.length, exactMembership: true, foreignRead: 404, limits: 'Native persisted manual correspondence; no external mail delivery or100-message browser rendering claim.' }), contentType: 'application/json' });
} finally { await account.api.dispose(); await other.api.dispose(); }