Browse Source

Fix Tests

pull/5027/head
Daniel Devaud 3 months ago
parent
commit
d1d5b16d16
  1. 7
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell-in-two-activities.spec.ts
  2. 7
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell.spec.ts
  3. 3
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy.spec.ts
  4. 3
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts
  5. 3
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-fee.spec.ts
  6. 37
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-googl-buy.spec.ts
  7. 3
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-item.spec.ts
  8. 3
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-liability.spec.ts
  9. 3
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-with-dividend.spec.ts
  10. 3
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-no-orders.spec.ts
  11. 7
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell-partially.spec.ts

7
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell-in-two-activities.spec.ts

@ -79,8 +79,7 @@ describe('PortfolioCalculator', () => {
currentRateService, currentRateService,
exchangeRateDataService, exchangeRateDataService,
portfolioSnapshotService, portfolioSnapshotService,
redisCacheService, redisCacheService
null
); );
}); });
@ -177,9 +176,7 @@ describe('PortfolioCalculator', () => {
netPerformancePercentageWithCurrencyEffectMap: { netPerformancePercentageWithCurrencyEffectMap: {
max: new Big('-0.0552834149755073478') max: new Big('-0.0552834149755073478')
}, },
netPerformanceWithCurrencyEffectMap: { netPerformanceWithCurrencyEffectMap: { max: new Big('-15.8') },
max: new Big('-15.8')
},
marketPrice: 148.9, marketPrice: 148.9,
marketPriceInBaseCurrency: 148.9, marketPriceInBaseCurrency: 148.9,
quantity: new Big('0'), quantity: new Big('0'),

7
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell.spec.ts

@ -79,8 +79,7 @@ describe('PortfolioCalculator', () => {
currentRateService, currentRateService,
exchangeRateDataService, exchangeRateDataService,
portfolioSnapshotService, portfolioSnapshotService,
redisCacheService, redisCacheService
null
); );
}); });
@ -164,9 +163,7 @@ describe('PortfolioCalculator', () => {
netPerformancePercentageWithCurrencyEffectMap: { netPerformancePercentageWithCurrencyEffectMap: {
max: new Big('-0.0552834149755073478') max: new Big('-0.0552834149755073478')
}, },
netPerformanceWithCurrencyEffectMap: { netPerformanceWithCurrencyEffectMap: { max: new Big('-15.8') },
max: new Big('-15.8')
},
marketPrice: 148.9, marketPrice: 148.9,
marketPriceInBaseCurrency: 148.9, marketPriceInBaseCurrency: 148.9,
quantity: new Big('0'), quantity: new Big('0'),

3
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy.spec.ts

@ -79,8 +79,7 @@ describe('PortfolioCalculator', () => {
currentRateService, currentRateService,
exchangeRateDataService, exchangeRateDataService,
portfolioSnapshotService, portfolioSnapshotService,
redisCacheService, redisCacheService
null
); );
}); });

3
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts

@ -92,8 +92,7 @@ describe('PortfolioCalculator', () => {
currentRateService, currentRateService,
exchangeRateDataService, exchangeRateDataService,
portfolioSnapshotService, portfolioSnapshotService,
redisCacheService, redisCacheService
null
); );
}); });

3
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-fee.spec.ts

@ -79,8 +79,7 @@ describe('PortfolioCalculator', () => {
currentRateService, currentRateService,
exchangeRateDataService, exchangeRateDataService,
portfolioSnapshotService, portfolioSnapshotService,
redisCacheService, redisCacheService
null
); );
}); });

37
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-googl-buy.spec.ts

@ -92,8 +92,7 @@ describe('PortfolioCalculator', () => {
currentRateService, currentRateService,
exchangeRateDataService, exchangeRateDataService,
portfolioSnapshotService, portfolioSnapshotService,
redisCacheService, redisCacheService
null
); );
}); });
@ -162,9 +161,7 @@ describe('PortfolioCalculator', () => {
netPerformancePercentageWithCurrencyEffectMap: { netPerformancePercentageWithCurrencyEffectMap: {
max: new Big('0.24112962014285697628') max: new Big('0.24112962014285697628')
}, },
netPerformanceWithCurrencyEffectMap: { netPerformanceWithCurrencyEffectMap: { max: new Big('19.851974') },
max: new Big('19.851974')
},
marketPrice: 116.45, marketPrice: 116.45,
marketPriceInBaseCurrency: 103.10483, marketPriceInBaseCurrency: 103.10483,
quantity: new Big('1'), quantity: new Big('1'),
@ -200,30 +197,12 @@ describe('PortfolioCalculator', () => {
expect(investmentsByMonth).toEqual([ expect(investmentsByMonth).toEqual([
{ date: '2023-01-01', investment: 82.329056 }, { date: '2023-01-01', investment: 82.329056 },
{ { date: '2023-02-01', investment: 0 },
date: '2023-02-01', { date: '2023-03-01', investment: 0 },
investment: 0 { date: '2023-04-01', investment: 0 },
}, { date: '2023-05-01', investment: 0 },
{ { date: '2023-06-01', investment: 0 },
date: '2023-03-01', { date: '2023-07-01', investment: 0 }
investment: 0
},
{
date: '2023-04-01',
investment: 0
},
{
date: '2023-05-01',
investment: 0
},
{
date: '2023-06-01',
investment: 0
},
{
date: '2023-07-01',
investment: 0
}
]); ]);
}); });
}); });

3
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-item.spec.ts

@ -79,8 +79,7 @@ describe('PortfolioCalculator', () => {
currentRateService, currentRateService,
exchangeRateDataService, exchangeRateDataService,
portfolioSnapshotService, portfolioSnapshotService,
redisCacheService, redisCacheService
null
); );
}); });

3
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-liability.spec.ts

@ -79,8 +79,7 @@ describe('PortfolioCalculator', () => {
currentRateService, currentRateService,
exchangeRateDataService, exchangeRateDataService,
portfolioSnapshotService, portfolioSnapshotService,
redisCacheService, redisCacheService
null
); );
}); });

3
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-with-dividend.spec.ts

@ -92,8 +92,7 @@ describe('PortfolioCalculator', () => {
currentRateService, currentRateService,
exchangeRateDataService, exchangeRateDataService,
portfolioSnapshotService, portfolioSnapshotService,
redisCacheService, redisCacheService
null
); );
}); });

3
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-no-orders.spec.ts

@ -74,8 +74,7 @@ describe('PortfolioCalculator', () => {
currentRateService, currentRateService,
exchangeRateDataService, exchangeRateDataService,
portfolioSnapshotService, portfolioSnapshotService,
redisCacheService, redisCacheService
null
); );
}); });

7
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell-partially.spec.ts

@ -93,8 +93,7 @@ describe('PortfolioCalculator', () => {
currentRateService, currentRateService,
exchangeRateDataService, exchangeRateDataService,
portfolioSnapshotService, portfolioSnapshotService,
redisCacheService, redisCacheService
null
); );
}); });
@ -158,9 +157,7 @@ describe('PortfolioCalculator', () => {
netPerformancePercentageWithCurrencyEffectMap: { netPerformancePercentageWithCurrencyEffectMap: {
max: new Big('0.12348284960422163588') max: new Big('0.12348284960422163588')
}, },
netPerformanceWithCurrencyEffectMap: { netPerformanceWithCurrencyEffectMap: { max: new Big('17.68') },
max: new Big('17.68')
},
marketPrice: 87.8, marketPrice: 87.8,
marketPriceInBaseCurrency: 87.8, marketPriceInBaseCurrency: 87.8,
quantity: new Big('1'), quantity: new Big('1'),

Loading…
Cancel
Save