feat: add attachment download and message attachment links

This commit is contained in:
2026-11-05 15:23:15 +03:00
parent fa0211eecb
commit f523cad721
10 changed files with 486 additions and 17 deletions
+8 -2
View File
@@ -405,7 +405,7 @@ describe('API мессенджера (e2e) — граничные случаи
expect(res.body.error.code).toBe('invalid_request');
});
it('считает attachment_ids: [] равным отсутствию поля, непустой список отклоняет', async () => {
it('считает attachment_ids: [] равным отсутствию поля, неизвестный ID — 404, неверный тип — 400', async () => {
const alice = await createUser('aliceatt');
const bob = await createUser('bobatt');
const chat = await createChat(alice, bob);
@@ -424,7 +424,13 @@ describe('API мессенджера (e2e) — граничные случаи
.send({ attachment_ids: [], text: 'att' })
.expect(201);
expect(replay.body).toEqual(first.body);
for (const attachment_ids of [[randomUUID()], null, 'x']) {
await request(server)
.post(path)
.set('Idempotency-Key', randomUUID())
.set('Authorization', bearer(alice))
.send({ text: 'x', attachment_ids: [randomUUID()] })
.expect(404);
for (const attachment_ids of [null, 'x']) {
await request(server)
.post(path)
.set('Idempotency-Key', randomUUID())