signal-desktop/ts/test-both/processSyncMessage_test.ts

39 lines
891 B
TypeScript
Raw Normal View History

2021-07-09 19:36:10 +00:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { assert } from 'chai';
import { generateAci } from '../types/ServiceId';
2021-07-09 19:36:10 +00:00
import { processSyncMessage } from '../textsecure/processSyncMessage';
describe('processSyncMessage', () => {
const destinationServiceId = generateAci();
2021-07-09 19:36:10 +00:00
it('should normalize UUIDs in sent', () => {
2021-07-09 19:36:10 +00:00
const out = processSyncMessage({
sent: {
destinationServiceId: destinationServiceId.toUpperCase(),
2021-07-09 19:36:10 +00:00
unidentifiedStatus: [
{
destinationServiceId: destinationServiceId.toUpperCase(),
2021-07-09 19:36:10 +00:00
},
],
},
});
assert.deepStrictEqual(out, {
sent: {
destinationServiceId,
2021-07-09 19:36:10 +00:00
2023-06-29 19:17:27 +00:00
storyMessageRecipients: undefined,
2021-07-09 19:36:10 +00:00
unidentifiedStatus: [
{
destinationServiceId,
2021-07-09 19:36:10 +00:00
},
],
},
});
});
});