diff --git a/tests/client.js b/tests/client.js index 6055c18..813e92f 100644 --- a/tests/client.js +++ b/tests/client.js @@ -349,7 +349,16 @@ END:VCARD`; expect(msg.vCards[1]).to.match(/BEGIN:VCARD/); }); }); - + describe('Get Messages', function() { + it ('can get a message by it\'s ID', async function() { + const chat = await client.getChatById(remoteId); + const [message] = await chat.fetchMessages({limit: 1}); + const messageById = await client.getMessageById(message.id._serialized); + expect(messageById).to.exist; + expect(messageById).to.be.instanceOf(Message); + expect(messageById).to.be.equal(message); + }) + }); describe('Get Chats', function () { it('can get a chat by its ID', async function () { const chat = await client.getChatById(remoteId); @@ -385,7 +394,6 @@ END:VCARD`; expect(contact).to.be.instanceOf(Contact); }); }); - describe('Numbers and Users', function () { it('can verify that a user is registered', async function () { const isRegistered = await client.isRegisteredUser(remoteId); @@ -414,4 +422,4 @@ END:VCARD`; }); }); }); -}); \ No newline at end of file +});