forked from mtusi2026/mtusi2026lab5
lab5: e2e, fault suite и доказательства
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user