Browse Source

test(portfolio): assert a future account balance is ignored

Adds the future-dated balance suggested in ghostfolio/ghostfolio#6185 to the
cash calculator mock. Without the preceding fix the USD position reports
activitiesCount 3 instead of 2, along with a zeroed average price and
investment.
pull/7385/head
Arham Amin 1 month ago
parent
commit
adc5cfb3df
  1. 8
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-cash.spec.ts

8
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-cash.spec.ts

@ -161,6 +161,14 @@ describe('PortfolioCalculator', () => {
id: randomUUID(),
value: 2000,
valueInBaseCurrency: 1800
},
{
// Ignored future account balance
accountId,
date: parseDate('2050-12-31'),
id: randomUUID(),
value: 0,
valueInBaseCurrency: 0
}
]
});

Loading…
Cancel
Save