salix/back/methods/message/specs/send.spec.js

15 lines
482 B
JavaScript
Raw Normal View History

2018-12-21 11:50:28 +00:00
const app = require(`${serviceRoot}/server/server`);
describe('message send()', () => {
it('should call the send method and return the response', async() => {
let ctx = {req: {accessToken: {userId: 1}}};
2018-10-08 05:31:55 +00:00
let params = {
recipientFk: 1,
message: 'I changed something'
};
let response = await app.models.Message.send(ctx, params, {transaction: 'You'});
expect(response.message).toEqual(params.message);
});
});