|
|
@ -133,6 +133,11 @@ describe('PortfolioCalculator', () => { |
|
|
groupBy: 'month' |
|
|
groupBy: 'month' |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const investmentsByYear = portfolioCalculator.getInvestmentsByGroup({ |
|
|
|
|
|
data: portfolioSnapshot.historicalData, |
|
|
|
|
|
groupBy: 'year' |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
expect(portfolioSnapshot).toMatchObject({ |
|
|
expect(portfolioSnapshot).toMatchObject({ |
|
|
currentValueInBaseCurrency: new Big('595.6'), |
|
|
currentValueInBaseCurrency: new Big('595.6'), |
|
|
errors: [], |
|
|
errors: [], |
|
|
@ -204,6 +209,10 @@ describe('PortfolioCalculator', () => { |
|
|
{ date: '2021-11-01', investment: 559 }, |
|
|
{ date: '2021-11-01', investment: 559 }, |
|
|
{ date: '2021-12-01', investment: 0 } |
|
|
{ date: '2021-12-01', investment: 0 } |
|
|
]); |
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
expect(investmentsByYear).toEqual([ |
|
|
|
|
|
{ date: '2021-01-01', investment: 559 } |
|
|
|
|
|
]); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|