2019-01-24 08:08:28 +00:00
|
|
|
const app = require('vn-loopback/server/server');
|
2018-04-20 13:16:03 +00:00
|
|
|
|
|
|
|
describe('message send()', () => {
|
2018-08-01 12:01:42 +00:00
|
|
|
it('should call the send method and return the response', async() => {
|
2018-04-20 13:16:03 +00:00
|
|
|
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);
|
2018-04-20 13:16:03 +00:00
|
|
|
});
|
|
|
|
});
|