Send related emoji along with Sticker, fix SendMessage types

This commit is contained in:
Scott Nonnenberg 2021-10-05 15:10:08 -07:00 committed by GitHub
parent 3c91dce993
commit bd380086a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 522 additions and 376 deletions

View file

@ -1,4 +1,4 @@
// Copyright 2018-2020 Signal Messenger, LLC
// Copyright 2018-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
const fs = require('fs');
@ -222,14 +222,14 @@ describe('Attachments', () => {
});
});
it('returns a function that copies the source path into the attachments directory', async function thisNeeded() {
it('returns a function that copies the source path into the attachments directory and returns its path and size', async function thisNeeded() {
const attachmentsPath = await this.getFakeAttachmentsDirectory();
const someOtherPath = path.join(app.getPath('userData'), 'somethingElse');
await fse.outputFile(someOtherPath, 'hello world');
this.filesToRemove.push(someOtherPath);
const copier = Attachments.copyIntoAttachmentsDirectory(attachmentsPath);
const relativePath = await copier(someOtherPath);
const { path: relativePath, size } = await copier(someOtherPath);
const absolutePath = path.join(attachmentsPath, relativePath);
assert.notEqual(someOtherPath, absolutePath);
@ -237,6 +237,8 @@ describe('Attachments', () => {
await fs.promises.readFile(absolutePath, 'utf8'),
'hello world'
);
assert.strictEqual(size, 'hello world'.length);
});
});