const models = require('vn-loopback/server/server').models; describe('Chat sendCheckingPresence()', () => { it('should return true as response', async() => { const workerId = 1107; let ctx = {req: {accessToken: {userId: 1}}}; let response = await models.Chat.sendCheckingPresence(ctx, workerId, 'I changed something'); expect(response).toEqual(true); }); it('should return false as response', async() => { const salesPersonId = 18; let ctx = {req: {accessToken: {userId: 18}}}; let response = await models.Chat.sendCheckingPresence(ctx, salesPersonId, 'I changed something'); expect(response).toEqual(false); }); });