Resumable attachment downloads

This commit is contained in:
Fedor Indutny 2024-08-19 13:05:35 -07:00 committed by GitHub
parent 2c92591b59
commit 38f532cdda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 401 additions and 89 deletions

View file

@ -46,7 +46,10 @@ describe('processDataMessage', () => {
timestamp: Long.fromNumber(TIMESTAMP),
...message,
},
TIMESTAMP
TIMESTAMP,
{
_createName: () => 'random-path',
}
);
it('should process attachments', () => {
@ -54,7 +57,12 @@ describe('processDataMessage', () => {
attachments: [UNPROCESSED_ATTACHMENT],
});
assert.deepStrictEqual(out.attachments, [PROCESSED_ATTACHMENT]);
assert.deepStrictEqual(out.attachments, [
{
...PROCESSED_ATTACHMENT,
downloadPath: 'random-path',
},
]);
});
it('should process attachments with 0 cdnId', () => {
@ -71,6 +79,7 @@ describe('processDataMessage', () => {
{
...PROCESSED_ATTACHMENT,
cdnId: undefined,
downloadPath: 'random-path',
},
]);
});