Backup and end-to-end test!

This commit is contained in:
Scott Nonnenberg 2018-04-20 14:55:33 -07:00
parent c3acf43c47
commit a7d44d3344
No known key found for this signature in database
GPG key ID: 5F82280C35134661
6 changed files with 477 additions and 28 deletions

View file

@ -67,6 +67,43 @@ describe('Message', () => {
await Message.createAttachmentDataWriter(writeExistingAttachmentData)(input);
assert.deepEqual(actual, expected);
});
it('should process quote attachment thumbnails', async () => {
const input = {
body: 'Imagine there is no heaven…',
schemaVersion: 4,
attachments: [],
quote: {
attachments: [{
thumbnail: {
path: 'ab/abcdefghi',
data: stringToArrayBuffer('Its easy if you try'),
},
}],
},
};
const expected = {
body: 'Imagine there is no heaven…',
schemaVersion: 4,
attachments: [],
quote: {
attachments: [{
thumbnail: {
path: 'ab/abcdefghi',
},
}],
},
};
const writeExistingAttachmentData = (attachment) => {
assert.equal(attachment.path, 'ab/abcdefghi');
assert.deepEqual(attachment.data, stringToArrayBuffer('Its easy if you try'));
};
const actual =
await Message.createAttachmentDataWriter(writeExistingAttachmentData)(input);
assert.deepEqual(actual, expected);
});
});
describe('initializeSchemaVersion', () => {