feat: add upload experiment, attachment scenarios and health extension

This commit is contained in:
2026-11-05 16:26:15 +03:00
parent a7980a4cb8
commit 5c3cba4951
8 changed files with 552 additions and 8 deletions
+18
View File
@@ -325,6 +325,24 @@ describe('Загрузка вложений (e2e)', () => {
}
});
it('необработанная ошибка PostgreSQL при INSERT — 503, объект не удаляется', async () => {
const prisma = app.get(PrismaService);
const s3 = app.get(S3Service);
const remove = jest.spyOn(s3, 'delete');
const create = jest.spyOn(prisma.attachment, 'create').mockRejectedValueOnce(
new Prisma.PrismaClientUnknownRequestError('server closed the connection', {
clientVersion: 'test',
}),
);
try {
expectError(await upload(SAMPLE_PNG), 503, 'unavailable');
expect(remove).not.toHaveBeenCalled();
} finally {
create.mockRestore();
remove.mockRestore();
}
});
it('при неясном исходе COMMIT объект не удаляется', async () => {
const prisma = app.get(PrismaService);
const s3 = app.get(S3Service);