2018-12-21 11:50:28 +00:00
|
|
|
const app = require(`${serviceRoot}/server/server`);
|
2018-08-22 12:24:33 +00:00
|
|
|
|
|
|
|
describe('workerMana getCurrentWorkerMana()', () => {
|
|
|
|
it('should get the mana of the logged worker', async() => {
|
|
|
|
let mana = await app.models.WorkerMana.getCurrentWorkerMana({req: {accessToken: {userId: 18}}});
|
|
|
|
|
2018-09-21 13:01:51 +00:00
|
|
|
expect(mana).toEqual(221);
|
2018-08-22 12:24:33 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|