Skip to content

Commit

Permalink
Add tests for chat.react endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Apr 2, 2018
1 parent 4ae91d0 commit 1c06b2c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/end-to-end/api/05-chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]', () => {
Expand Down

0 comments on commit 1c06b2c

Please sign in to comment.