diff --git a/modules/client/front/balance/index/index.html b/modules/client/front/balance/index/index.html index f42998bbd..8cdb5c971 100644 --- a/modules/client/front/balance/index/index.html +++ b/modules/client/front/balance/index/index.html @@ -85,9 +85,9 @@ {{::balance.bankFk}} - {{::balance.debit | currency: 'EUR':2}} - {{::balance.credit | currency: 'EUR':2}} - {{balance.balance | currency: 'EUR':2}} + {{::balance.debit | currency: 'EUR':2}} + {{::balance.credit | currency: 'EUR':2}} + {{balance.balance | currency: 'EUR':2}} { expect(expectedBalances[2].balance).toEqual(213.24); }); }); + + describe('balances() setter', () => { + it('should set the balances data and not call the getBalances() method', () => { + spyOn(controller, 'getBalances'); + controller.$.riskModel.data = null; + controller.balances = [{ + id: 1, + debit: 1000, + credit: null + }, { + id: 2, + debit: null, + credit: 500 + }, { + id: 3, + debit: null, + credit: 300 + }]; + + expect(controller.balances).toBeDefined(); + expect(controller.getBalances).not.toHaveBeenCalledWith(); + }); + + it('should set the balances data and then call the getBalances() method', () => { + spyOn(controller, 'getBalances'); + controller.balances = [{ + id: 1, + debit: 1000, + credit: null + }, { + id: 2, + debit: null, + credit: 500 + }, { + id: 3, + debit: null, + credit: 300 + }]; + + expect(controller.balances).toBeDefined(); + expect(controller.getBalances).toHaveBeenCalledWith(); + }); + }); }); });