@ -208,28 +208,6 @@ describe('Portfolio', () => {
}
} ) ;
} ) ;
it ( 'should return zero performance for 1d' , async ( ) = > {
const performance = await portfolio . getPerformance ( '1d' ) ;
expect ( performance ) . toEqual ( {
currentGrossPerformance : 0 ,
currentGrossPerformancePercent : 0 ,
currentNetPerformance : 0 ,
currentNetPerformancePercent : 0 ,
currentValue : 0
} ) ;
} ) ;
it ( 'should return zero performance for max' , async ( ) = > {
const performance = await portfolio . getPerformance ( 'max' ) ;
expect ( performance ) . toEqual ( {
currentGrossPerformance : 0 ,
currentGrossPerformancePercent : 0 ,
currentNetPerformance : 0 ,
currentNetPerformancePercent : 0 ,
currentValue : 0
} ) ;
} ) ;
} ) ;
describe ( ` works with today's orders ` , ( ) = > {
@ -303,32 +281,6 @@ describe('Portfolio', () => {
expect ( portfolio . getFees ( ) ) . toEqual ( 0 ) ;
/ * c o n s t p e r f o r m a n c e 1 d = a w a i t p o r t f o l i o . g e t P e r f o r m a n c e ( ' 1 d ' ) ;
expect ( performance1d ) . toEqual ( {
currentGrossPerformance : 0 ,
currentGrossPerformancePercent : 0 ,
currentNetPerformance : 0 ,
currentNetPerformancePercent : 0 ,
currentValue : exchangeRateDataService.toBaseCurrency (
1 * 49631.24 ,
Currency . USD ,
baseCurrency
)
} ) ; * /
/ * c o n s t p e r f o r m a n c e M a x = a w a i t p o r t f o l i o . g e t P e r f o r m a n c e ( ' m a x ' ) ;
expect ( performanceMax ) . toEqual ( {
currentGrossPerformance : 0 ,
currentGrossPerformancePercent : 0 ,
currentNetPerformance : 0 ,
currentNetPerformancePercent : 0 ,
currentValue : exchangeRateDataService.toBaseCurrency (
1 * 49631.24 ,
Currency . USD ,
baseCurrency
)
} ) ; * /
expect ( portfolio . getPositions ( getYesterday ( ) ) ) . toMatchObject ( { } ) ;
expect ( portfolio . getSymbols ( getYesterday ( ) ) ) . toEqual ( [ ] ) ;
@ -367,55 +319,8 @@ describe('Portfolio', () => {
)
) ;
/ * c o n s t d e t a i l s = a w a i t p o r t f o l i o . g e t D e t a i l s ( ' 1 d ' ) ;
expect ( details ) . toMatchObject ( {
ETHUSD : {
accounts : {
[ UNKNOWN_KEY ] : {
current : exchangeRateDataService.toCurrency (
0.2 * 991.49 ,
Currency . USD ,
baseCurrency
) ,
original : exchangeRateDataService.toCurrency (
0.2 * 991.49 ,
Currency . USD ,
baseCurrency
)
}
} ,
// allocationCurrent: 1,
allocationInvestment : 1 ,
countries : [ ] ,
currency : Currency.USD ,
exchange : UNKNOWN_KEY ,
// grossPerformance: 0,
// grossPerformancePercent: 0,
investment : exchangeRateDataService.toCurrency (
0.2 * 991.49 ,
Currency . USD ,
baseCurrency
) ,
marketPrice : 3915.337 ,
name : 'Ethereum USD' ,
quantity : 0.2 ,
transactionCount : 1 ,
symbol : 'ETHUSD' ,
type : 'Cryptocurrency'
}
} ) ; * /
expect ( portfolio . getFees ( ) ) . toEqual ( 0 ) ;
/ * c o n s t p e r f o r m a n c e = a w a i t p o r t f o l i o . g e t P e r f o r m a n c e ( ' m a x ' ) ;
expect ( performance ) . toEqual ( {
currentGrossPerformance : 0 ,
currentGrossPerformancePercent : 0 ,
currentNetPerformance : 0 ,
currentNetPerformancePercent : 0 ,
currentValue : 0
} ) ; * /
expect ( portfolio . getPositions ( getYesterday ( ) ) ) . toMatchObject ( {
ETHUSD : {
averagePrice : 991.49 ,