From 3fb00d3a39bf4a80cc5cdd959cc5234d86f3f835 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 26 Oct 2025 08:29:11 +0100 Subject: [PATCH] Set up test --- ...ulator-btceur-in-base-currency-eur.spec.ts | 51 ++----------------- 1 file changed, 4 insertions(+), 47 deletions(-) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur-in-base-currency-eur.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur-in-base-currency-eur.spec.ts index 78fa86323..f48d774ae 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur-in-base-currency-eur.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur-in-base-currency-eur.spec.ts @@ -125,58 +125,15 @@ describe('PortfolioCalculator', () => { const portfolioCalculator = portfolioCalculatorFactory.createCalculator({ activities, calculationType: PerformanceCalculationType.ROAI, - currency: 'CHF', + currency: 'EUR', userId: userDummyData.id }); const portfolioSnapshot = await portfolioCalculator.computeSnapshot(); - expect(portfolioSnapshot).toMatchObject({ - currentValueInBaseCurrency: new Big('43099.7'), - errors: [], - hasErrors: false, - positions: [ - { - averagePrice: new Big('44558.42'), - currency: 'USD', - dataSource: 'YAHOO', - dividend: new Big('0'), - dividendInBaseCurrency: new Big('0'), - fee: new Big('4.46'), - feeInBaseCurrency: new Big('3.94'), - firstBuyDate: '2021-12-12', - grossPerformance: new Big('-1458.72'), - grossPerformancePercentage: new Big('-0.03273724696701543726'), - grossPerformancePercentageWithCurrencyEffect: new Big( - '-0.03273724696701543726' - ), - grossPerformanceWithCurrencyEffect: new Big('-1458.72'), - investment: new Big('44558.42'), - investmentWithCurrencyEffect: new Big('44558.42'), - netPerformance: new Big('-1463.18'), - netPerformancePercentage: new Big('-0.03283734028271199921'), - netPerformancePercentageWithCurrencyEffectMap: { - max: new Big('-0.03283734028271199921') - }, - netPerformanceWithCurrencyEffectMap: { - max: new Big('-1463.18') - }, - marketPrice: 43099.7, - marketPriceInBaseCurrency: 43099.7, - quantity: new Big('1'), - symbol: 'BTCUSD', - tags: [], - timeWeightedInvestment: new Big('44558.42'), - timeWeightedInvestmentWithCurrencyEffect: new Big('44558.42'), - transactionCount: 1, - valueInBaseCurrency: new Big('43099.7') - } - ], - totalFeesWithCurrencyEffect: new Big('4.46'), - totalInterestWithCurrencyEffect: new Big('0'), - totalInvestment: new Big('44558.42'), - totalInvestmentWithCurrencyEffect: new Big('44558.42'), - totalLiabilitiesWithCurrencyEffect: new Big('0') + expect(portfolioSnapshot.positions[0]).toMatchObject({ + fee: new Big('4.46'), + feeInBaseCurrency: new Big('3.94') }); }); });