feat: add configurable timeline range
This commit is contained in:
@@ -90,6 +90,14 @@ describe('timeline projection', () => {
|
||||
expect(timelinePositionPercent('2022-07-02', range)).toBeGreaterThan(49)
|
||||
expect(timelinePositionPercent('2022-07-02', range)).toBeLessThan(51)
|
||||
})
|
||||
|
||||
it('uses a valid configured date range without automatic year padding', () => {
|
||||
const range = timelineRange(['1987-01-08', '1987-10-24'], 2026, { start: '1987-10-01', end: '1987-10-31' })
|
||||
expect(new Date(range.start).toISOString()).toBe('1987-10-01T00:00:00.000Z')
|
||||
expect(new Date(range.end).toISOString()).toBe('1987-10-31T23:59:59.999Z')
|
||||
expect(timelinePositionPercent('1987-10-16', range)).toBeGreaterThan(48)
|
||||
expect(timelinePositionPercent('1987-10-16', range)).toBeLessThan(52)
|
||||
})
|
||||
})
|
||||
|
||||
describe('folder domain behavior', () => {
|
||||
|
||||
Reference in New Issue
Block a user