lab5: e2e, fault suite и доказательства

This commit is contained in:
2026-11-05 01:17:58 +03:00
parent d19824f546
commit 551cf70989
28 changed files with 2269 additions and 60 deletions
+7 -3
View File
@@ -17,6 +17,7 @@ import {
http,
json,
postMessage,
waitReady,
} from './support/e2e.js';
import { noisePng, pixelBombPng } from './support/png.js';
@@ -102,7 +103,7 @@ describe('direct upload (presigned PUT)', () => {
);
expect(Date.parse(ticket.expires_at)).toBeGreaterThan(Date.now());
expect(new URL(ticket.url).pathname).toBe(
`/messenger-attachments/attachments/${ticket.attachment_id}/original`,
`/messenger-attachments/staging/${ticket.attachment_id}/original`,
);
const hidden = await http<ApiErrorBody>(
@@ -143,11 +144,14 @@ describe('direct upload (presigned PUT)', () => {
content_type: 'image/png',
size_bytes: png.length,
sha256: sha256(png),
status: 'ready',
status: 'queued',
});
const ready = await waitReady(alice.token, ticket.attachment_id);
expect(ready.status).toBe('ready');
expect(ready.variants).toHaveLength(3);
const again = await complete(alice.token, ticket.attachment_id);
expect(again.response.status).toBe(200);
expect(again.body).toEqual(done.body);
expect(again.body.status).toBe('ready');
const content = await download(bob.token, ticket.attachment_id);
expect(content.response.status).toBe(200);