Browse Source

Move total return from experimental to general availability

pull/7990/head
Thomas Kaul 2 weeks ago
parent
commit
67c37694a4
  1. 41
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-googl-fee-and-dividend.spec.ts

41
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-googl-fee-and-dividend.spec.ts

@ -122,9 +122,9 @@ describe('PortfolioCalculator', () => {
{ {
// The first activity of this asset profile is a fee, which is not an // The first activity of this asset profile is a fee, which is not an
// investment activity. Thus the holding is not included in the // investment activity. Thus the holding is not included in the
// holdings of the portfolio summary. But its fee and its dividend are // holdings of the portfolio summary, and its dividend is not part of
// part of the net performance, so its dividend is part of the // the dividend of the chart. But its fee and its dividend are part of
// dividend of the chart too // the net performance
...activityDummyData, ...activityDummyData,
assetProfile: { assetProfile: {
...assetProfileDummyData, ...assetProfileDummyData,
@ -180,8 +180,8 @@ describe('PortfolioCalculator', () => {
).toEqual(['MSFT']); ).toEqual(['MSFT']);
expect(portfolioSnapshot.historicalData.at(-1)).toMatchObject({ expect(portfolioSnapshot.historicalData.at(-1)).toMatchObject({
dividendInBaseCurrency: 5.62, dividendInBaseCurrency: 0.62,
dividendInPercentageWithCurrencyEffect: 0.01882242615044544, dividendInPercentageWithCurrencyEffect: 0.0020764954116149776,
netPerformance: 18.87, netPerformance: 18.87,
netPerformanceInPercentage: 0.06319914260834618 netPerformanceInPercentage: 0.06319914260834618
}); });
@ -189,8 +189,8 @@ describe('PortfolioCalculator', () => {
// The portfolio summary takes the dividend of the date range max // The portfolio summary takes the dividend of the date range max
expect(performanceByDateRange).toMatchObject({ expect(performanceByDateRange).toMatchObject({
max: { max: {
dividendInBaseCurrency: 5.62, dividendInBaseCurrency: 0.62,
dividendInPercentageWithCurrencyEffect: 0.01882242615044535, dividendInPercentageWithCurrencyEffect: 0.002076495411614967,
netPerformance: 18.87, netPerformance: 18.87,
netPerformanceInPercentage: 0.06319914260834586 netPerformanceInPercentage: 0.06319914260834586
} }
@ -234,9 +234,8 @@ describe('PortfolioCalculator', () => {
unitPriceInAssetProfileCurrency: 0.62 unitPriceInAssetProfileCurrency: 0.62
}, },
{ {
// The holding has a dividend, but no average investment. The dividend // The holding has a dividend, but no average investment. Thus the
// is part of the net performance, so the dividend percentage is the // dividend percentage stays 0, like the dividend yield
// part of the net performance percentage. The dividend yield stays 0
...activityDummyData, ...activityDummyData,
assetProfile: { assetProfile: {
...assetProfileDummyData, ...assetProfileDummyData,
@ -275,7 +274,7 @@ describe('PortfolioCalculator', () => {
expect(portfolioSnapshot.historicalData.at(-1)).toMatchObject({ expect(portfolioSnapshot.historicalData.at(-1)).toMatchObject({
dividendInBaseCurrency: 5.62, dividendInBaseCurrency: 5.62,
dividendInPercentageWithCurrencyEffect: 0.01882242615044544, dividendInPercentageWithCurrencyEffect: 0,
netPerformance: 19.87, netPerformance: 19.87,
netPerformanceInPercentage: 0.06654832875611226 netPerformanceInPercentage: 0.06654832875611226
}); });
@ -283,7 +282,7 @@ describe('PortfolioCalculator', () => {
expect(performanceByDateRange).toMatchObject({ expect(performanceByDateRange).toMatchObject({
max: { max: {
dividendInBaseCurrency: 5.62, dividendInBaseCurrency: 5.62,
dividendInPercentageWithCurrencyEffect: 0.01882242615044535, dividendInPercentageWithCurrencyEffect: 0,
netPerformance: 19.87, netPerformance: 19.87,
netPerformanceInPercentage: 0.06654832875611194 netPerformanceInPercentage: 0.06654832875611194
} }
@ -327,9 +326,9 @@ describe('PortfolioCalculator', () => {
unitPriceInAssetProfileCurrency: 0.62 unitPriceInAssetProfileCurrency: 0.62
}, },
{ {
// The holding has no market price, thus it has no value. But its // The holding has no market price, thus it has no value. Its dividend
// dividend is part of the net performance, like the dividend of a // is part of the dividend of the chart, but not part of the net
// holding with a market price (see the scenario above) // performance (unlike the dividend in the scenario above)
...activityDummyData, ...activityDummyData,
assetProfile: { assetProfile: {
...assetProfileDummyData, ...assetProfileDummyData,
@ -366,17 +365,17 @@ describe('PortfolioCalculator', () => {
expect(portfolioSnapshot.historicalData.at(-1)).toMatchObject({ expect(portfolioSnapshot.historicalData.at(-1)).toMatchObject({
dividendInBaseCurrency: 5.62, dividendInBaseCurrency: 5.62,
dividendInPercentageWithCurrencyEffect: 0.01882242615044544, dividendInPercentageWithCurrencyEffect: 0,
netPerformance: 19.87, netPerformance: 14.87,
netPerformanceInPercentage: 0.06654832875611226 netPerformanceInPercentage: 0.0498023980172818
}); });
expect(performanceByDateRange).toMatchObject({ expect(performanceByDateRange).toMatchObject({
max: { max: {
dividendInBaseCurrency: 5.62, dividendInBaseCurrency: 5.62,
dividendInPercentageWithCurrencyEffect: 0.01882242615044535, dividendInPercentageWithCurrencyEffect: 0,
netPerformance: 19.87, netPerformance: 14.87,
netPerformanceInPercentage: 0.06654832875611194 netPerformanceInPercentage: 0.049802398017281556
} }
}); });
}); });

Loading…
Cancel
Save