Skip to content

Commit

Permalink
add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Dec 18, 2024
1 parent db47918 commit c70cbc9
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions apps/meteor/tests/end-to-end/api/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2082,6 +2082,32 @@ describe('Meteor.methods', () => {
})
.end(done);
});

it('should accept message sent by js.SDK', (done) => {
void request
.post(methodCall('sendMessage'))
.set(credentials)
.send({
message: JSON.stringify({
method: 'sendMessage',
params: [{ rid, msg: 'test message', bot: { i: 'js.SDK' } }],
id: 1000,
msg: 'method',
}),
})
.expect('Content-Type', 'application/json')
.expect(200)
.expect((res) => {
expect(res.body).to.have.property('success', true);

const data = JSON.parse(res.body.message);

expect(data).to.have.a.property('result').that.is.an('object');
expect(data.result).to.have.a.property('bot').that.is.an('object');
expect(data.result.bot).to.have.a.property('i', 'js.SDK');
})
.end(done);
});
});

describe('[@updateMessage]', () => {
Expand Down

0 comments on commit c70cbc9

Please sign in to comment.