salix/back/methods/chat/spec/send.spec.js

12 lines
424 B
JavaScript
Raw Normal View History

const app = require('vn-loopback/server/server');
describe('chat sendMessage()', () => {
it('should return a response', async() => {
let ctx = {req: {accessToken: {userId: 1}}};
let response = await app.models.Chat.sendMessage(ctx, '@salesPerson', 'I changed something');
expect(response.statusCode).toEqual(200);
expect(response.message).toEqual('Fake notification sent');
});
});