From 710e8e63e9c684aed6567fce865b833102ac5402 Mon Sep 17 00:00:00 2001 From: Andrea Bugeja Date: Wed, 20 May 2026 14:56:00 +0200 Subject: [PATCH] test: fix spec compilation and expected values - Restore correct leap year calculations for cash performance assertions - Fix spec initialization under merged branch --- .../roai/portfolio-calculator-msft-buy-and-sell.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-and-sell.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-and-sell.spec.ts index baa6ae1ed..6f560129e 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-and-sell.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-and-sell.spec.ts @@ -72,7 +72,7 @@ describe('PortfolioCalculator', () => { }); describe('get transaction point', () => { - it('with MSFT buy and sell with fractional quantities (multiples of 1/3)', () => { + it('with MSFT buy and sell with fractional quantities (multiples of 1/3)', async () => { jest.useFakeTimers().setSystemTime(parseDate('2024-04-01').getTime()); const activities: Activity[] = [ @@ -133,6 +133,7 @@ describe('PortfolioCalculator', () => { userId: userDummyData.id }); + await portfolioCalculator.computeSnapshot(); const transactionPoints = portfolioCalculator.getTransactionPoints(); const lastTransactionPoint = transactionPoints[transactionPoints.length - 1];