Remove messageCollection from Conversation model

This commit is contained in:
Scott Nonnenberg 2021-06-15 17:44:14 -07:00 committed by GitHub
parent 61ad1231df
commit 1520c80013
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 332 additions and 431 deletions

View file

@ -75,6 +75,8 @@ function deleteIndexedDB() {
/* Delete the database before running any tests */
before(async () => {
window.Signal.Util.MessageController.install();
await deleteIndexedDB();
try {
window.log.info('Initializing SQL in renderer');

View file

@ -615,11 +615,11 @@ describe('Backup', () => {
);
console.log('Backup test: Check messages');
const messageCollection = await window.Signal.Data._getAllMessages({
const messages = await window.Signal.Data._getAllMessages({
MessageCollection: Whisper.MessageCollection,
});
assert.strictEqual(messageCollection.length, MESSAGE_COUNT);
const messageFromDB = removeId(messageCollection.at(0).attributes);
assert.strictEqual(messages.length, MESSAGE_COUNT);
const messageFromDB = removeId(messages.at(0).attributes);
const expectedMessage = messageFromDB;
console.log({ messageFromDB, expectedMessage });
assert.deepEqual(messageFromDB, expectedMessage);