From 1c06b2c43edb1f8967017a0e98295584f734f2da Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Mon, 2 Apr 2018 13:39:36 -0300 Subject: [PATCH] Add tests for chat.react endpoint --- tests/end-to-end/api/05-chat.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/end-to-end/api/05-chat.js b/tests/end-to-end/api/05-chat.js index 2fc3c944fd2d..9d5b3f21455f 100644 --- a/tests/end-to-end/api/05-chat.js +++ b/tests/end-to-end/api/05-chat.js @@ -193,6 +193,36 @@ describe('[Chat]', function() { }) .end(done); }); + + it('should return statusCode: 200 when the emoji is valid and has no colons', (done) => { + request.post(api('chat.react')) + .set(credentials) + .send({ + emoji: 'bee', + messageId: message._id + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('should return statusCode: 200 for reaction property when the emoji is valid', (done) => { + request.post(api('chat.react')) + .set(credentials) + .send({ + reaction: 'ant', + messageId: message._id + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); }); describe('[/chat.getMessageReadReceipts]', () => {