salix/services/loopback/common/methods/message/specs/send.spec.js

13 lines
441 B
JavaScript

const app = require(`${servicesDir}/client/server/server`);
describe('message send()', () => {
it('should call the send method and return the response', done => {
let ctx = {req: {accessToken: {userId: 1}}};
app.models.Message.send('salesPerson', {message: 'I changed something'}, ctx)
.then(response => {
expect(response.sent).toEqual(1);
done();
});
});
});