Send proper sync message for edit msg in all contexts

This commit is contained in:
Josh Perez 2023-05-09 21:25:37 -04:00 committed by GitHub
parent 2177a79080
commit 46942ece00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 38 additions and 7 deletions

View file

@ -22,13 +22,20 @@ describe('maybeExpandErrors', () => {
});
it('wraps the provided value if a SendMessageProtoError with no errors', () => {
const input = new SendMessageProtoError({});
const input = new SendMessageProtoError({
dataMessage: undefined,
editMessage: undefined,
});
assert.sameMembers(expand(input), [input]);
});
it("uses a SendMessageProtoError's errors", () => {
const errors = [new Error('one'), new Error('two')];
const input = new SendMessageProtoError({ errors });
const input = new SendMessageProtoError({
dataMessage: undefined,
editMessage: undefined,
errors,
});
assert.strictEqual(expand(input), errors);
});
});