Normalize messages table

This commit is contained in:
Fedor Indutny
2025-01-16 13:34:35 -08:00
committed by GitHub
parent 9bec59b70a
commit 630a1fcc89
18 changed files with 490 additions and 240 deletions

View File

@@ -126,11 +126,9 @@ describe('Message', () => {
it('should initialize schema version to zero', () => {
const input = getDefaultMessage({
body: 'Imagine there is no heaven…',
attachments: [],
});
const expected = getDefaultMessage({
body: 'Imagine there is no heaven…',
attachments: [],
schemaVersion: 0,
});
@@ -203,7 +201,6 @@ describe('Message', () => {
hasVisualMediaAttachments: undefined,
hasFileAttachments: undefined,
schemaVersion: Message.CURRENT_SCHEMA_VERSION,
contact: [],
});
const expectedAttachmentData = 'Its easy if you try';
@@ -655,7 +652,6 @@ describe('Message', () => {
});
const expected = getDefaultMessage({
body: 'hey there!',
contact: [],
});
const result = await upgradeVersion(message, getDefaultContext());
assert.deepEqual(result, expected);
@@ -848,7 +844,6 @@ describe('Message', () => {
key: 'key',
},
],
contact: [],
});
const result = await Message.upgradeSchema(message, {
...getDefaultContext(),