|
|
|
@ -75,5 +75,22 @@ describe('GfHistoricalMarketDataEditorComponent', () => { |
|
|
|
|
|
|
|
expect(component.marketDataByMonth['2026-11']['29'].marketPrice).toBe(1); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should include today if all items are in the future', () => { |
|
|
|
jest.useFakeTimers().setSystemTime(new Date(2026, 10, 29, 20)); |
|
|
|
|
|
|
|
fixture.componentRef.setInput('marketData', [ |
|
|
|
{ date: new Date(2027, 0, 15), marketPrice: 1 } |
|
|
|
]); |
|
|
|
|
|
|
|
fixture.detectChanges(); |
|
|
|
|
|
|
|
expect(Object.keys(component.marketDataByMonth).sort()).toEqual([ |
|
|
|
'2026-11', |
|
|
|
'2026-12', |
|
|
|
'2027-01' |
|
|
|
]); |
|
|
|
expect(component.marketDataByMonth['2026-11']['29']).toBeDefined(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|