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

18 lines
615 B
JavaScript
Raw Normal View History

const app = require('vn-loopback/server/server');
2021-02-01 08:29:47 +00:00
describe('Chat send()', () => {
2019-11-14 07:16:52 +00:00
it('should return a "Fake notification sent" as response', async() => {
let ctx = {req: {accessToken: {userId: 1}}};
2020-01-20 10:59:15 +00:00
let response = await app.models.Chat.send(ctx, '@salesPerson', 'I changed something');
2022-04-11 12:43:20 +00:00
expect(response).toEqual(true);
});
2019-11-14 07:16:52 +00:00
it('should retrun false as response', async() => {
2019-11-14 07:16:52 +00:00
let ctx = {req: {accessToken: {userId: 18}}};
2020-01-20 10:59:15 +00:00
let response = await app.models.Chat.send(ctx, '@salesPerson', 'I changed something');
2019-11-14 07:16:52 +00:00
2022-04-11 12:43:20 +00:00
expect(response).toEqual(false);
2019-11-14 07:16:52 +00:00
});
});