const models = require('vn-loopback/server/server').models;

describe('Greuge totalGreuge()', () => {
    it('should call the sumAmount method', async() => {
        const tx = await models.Client.beginTransaction({});

        try {
            const options = {transaction: tx};

            const clientId = 1101;

            const result = await models.Greuge.sumAmount(clientId, options);

            expect(result).toBe(203.71);

            await tx.rollback();
        } catch (e) {
            await tx.rollback();
            throw e;
        }
    });
});