Message Send Log to enable comprehensive resend

This commit is contained in:
Scott Nonnenberg 2021-07-15 16:48:09 -07:00 committed by GitHub
parent 0fe68b57b1
commit a42c41ed01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 3154 additions and 1266 deletions

View file

@ -5,6 +5,7 @@ import { assert } from 'chai';
import * as sinon from 'sinon';
import { setup as setupI18n } from '../../../js/modules/i18n';
import enMessages from '../../../_locales/en/messages.json';
import { CallbackResultType } from '../../textsecure/SendMessage';
import { SignalService as Proto } from '../../protobuf';
describe('Message', () => {
@ -71,7 +72,16 @@ describe('Message', () => {
it('updates the `sent` attribute', async () => {
const message = createMessage({ type: 'outgoing', source, sent: false });
await message.send(Promise.resolve({}));
const promise: Promise<CallbackResultType> = Promise.resolve({
successfulIdentifiers: [window.getGuid(), window.getGuid()],
errors: [
Object.assign(new Error('failed'), {
identifier: window.getGuid(),
}),
],
});
await message.send(promise);
assert.isTrue(message.get('sent'));
});