forked from mtusi2026/mtusi2026lab4
feat: add attachment download and message attachment links
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user