const app = require('vn-loopback/server/server'); describe('workerMana getCurrentWorkerMana()', () => { it('should get the mana of the logged worker', async() => { let mana = await app.models.WorkerMana.getCurrentWorkerMana({req: {accessToken: {userId: 18}}}); expect(mana).toEqual(221); }); it('should return 0 if the user doesnt uses mana', async() => { let mana = await app.models.WorkerMana.getCurrentWorkerMana({req: {accessToken: {userId: 9}}}); expect(mana).toEqual(0); }); });