On send, pull data from target edit if sending edit

This commit is contained in:
Scott Nonnenberg 2023-11-17 10:16:48 -08:00 committed by GitHub
parent 146b562c91
commit 48245eeea6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 529 additions and 135 deletions

View file

@ -183,7 +183,10 @@ describe('Message', () => {
editMessage: undefined,
});
await message.send(promise);
await message.send({
promise,
targetTimestamp: message.get('timestamp'),
});
const result = message.get('sendStateByConversationId') || {};
assert.hasAllKeys(result, [
@ -203,7 +206,10 @@ describe('Message', () => {
const message = createMessage({ type: 'outgoing', source });
const promise = Promise.reject(new Error('foo bar'));
await message.send(promise);
await message.send({
promise,
targetTimestamp: message.get('timestamp'),
});
const errors = message.get('errors') || [];
assert.lengthOf(errors, 1);
@ -217,7 +223,10 @@ describe('Message', () => {
errors: [new Error('baz qux')],
};
const promise = Promise.reject(result);
await message.send(promise);
await message.send({
promise,
targetTimestamp: message.get('timestamp'),
});
const errors = message.get('errors') || [];
assert.lengthOf(errors, 1);