|
|
@ -13,7 +13,6 @@ import { RedisCacheService } from '@ghostfolio/api/app/redis-cache/redis-cache.s |
|
|
|
import { RedisCacheServiceMock } from '@ghostfolio/api/app/redis-cache/redis-cache.service.mock'; |
|
|
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; |
|
|
|
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; |
|
|
|
import { ExchangeRateDataServiceMock } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service.mock'; |
|
|
|
import { PortfolioSnapshotService } from '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service'; |
|
|
|
import { PortfolioSnapshotServiceMock } from '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service.mock'; |
|
|
|
import { parseDate } from '@ghostfolio/common/helper'; |
|
|
@ -52,18 +51,6 @@ jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { |
|
|
|
}; |
|
|
|
}); |
|
|
|
|
|
|
|
jest.mock( |
|
|
|
'@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service', |
|
|
|
() => { |
|
|
|
return { |
|
|
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
|
|
ExchangeRateDataService: jest.fn().mockImplementation(() => { |
|
|
|
return ExchangeRateDataServiceMock; |
|
|
|
}) |
|
|
|
}; |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
describe('PortfolioCalculator', () => { |
|
|
|
let activityDtos: CreateOrderDto[]; |
|
|
|
|
|
|
@ -106,7 +93,7 @@ describe('PortfolioCalculator', () => { |
|
|
|
}); |
|
|
|
|
|
|
|
describe('get current positions', () => { |
|
|
|
it.only('with BTCUSD buy', async () => { |
|
|
|
it.only('with BTCUSD buy (in EUR)', async () => { |
|
|
|
jest.useFakeTimers().setSystemTime(parseDate('2022-01-14').getTime()); |
|
|
|
|
|
|
|
const activities: Activity[] = activityDtos.map((activity) => ({ |
|
|
|