2018-04-20 13:16:03 +00:00
|
|
|
const app = require(`${servicesDir}/client/server/server`);
|
|
|
|
|
|
|
|
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-08-01 12:01:42 +00:00
|
|
|
await app.models.Message.send('salesPerson', {message: 'I changed something'}, ctx)
|
2018-04-20 13:16:03 +00:00
|
|
|
.then(response => {
|
|
|
|
expect(response.sent).toEqual(1);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|