salix/services/loopback/common/methods/client/specs/activeBuyer.spec.js

14 lines
423 B
JavaScript

const app = require(`${servicesDir}/client/server/server`);
describe('Client activeBuyer', () => {
it('should return the buyers as result', async () => {
let filter = {};
let result = await app.models.Client.activeBuyer(filter);
let isBuyer = await app.models.Account.hasRole(result[0].id, 'buyer');
expect(result.length).toEqual(9);
expect(isBuyer).toBeTruthy();
});
});