2021-07-09 19:36:10 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import { assert } from 'chai';
|
2023-08-10 16:43:33 +00:00
|
|
|
import { generateAci } from '../types/ServiceId';
|
2021-07-09 19:36:10 +00:00
|
|
|
|
|
|
|
import { processSyncMessage } from '../textsecure/processSyncMessage';
|
|
|
|
|
|
|
|
describe('processSyncMessage', () => {
|
2023-08-10 16:43:33 +00:00
|
|
|
const destinationServiceId = generateAci();
|
2021-07-09 19:36:10 +00:00
|
|
|
|
2023-08-10 16:43:33 +00:00
|
|
|
it('should normalize UUIDs in sent', () => {
|
2021-07-09 19:36:10 +00:00
|
|
|
const out = processSyncMessage({
|
|
|
|
sent: {
|
2023-08-10 16:43:33 +00:00
|
|
|
destinationServiceId: destinationServiceId.toUpperCase(),
|
2021-07-09 19:36:10 +00:00
|
|
|
|
|
|
|
unidentifiedStatus: [
|
|
|
|
{
|
2023-08-10 16:43:33 +00:00
|
|
|
destinationServiceId: destinationServiceId.toUpperCase(),
|
2021-07-09 19:36:10 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
assert.deepStrictEqual(out, {
|
|
|
|
sent: {
|
2023-08-10 16:43:33 +00:00
|
|
|
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: [
|
|
|
|
{
|
2023-08-10 16:43:33 +00:00
|
|
|
destinationServiceId,
|
2021-07-09 19:36:10 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|