Check against the contract dates instead of the current maxStart and minEnd values to calculate the new maxStart and minEnds

This commit is contained in:
leigh-mil
2019-10-01 12:02:54 -04:00
parent b7677018c2
commit a5d34f9bb2
2 changed files with 6 additions and 4 deletions

View File

@@ -20,13 +20,13 @@ describe('PopDateRange Test', () => {
const component = new Vue(PopDateRange)
it('should calculate the max start date', () => {
component.maxStartDate = new Date('2020-01-01')
component.contractEnd = new Date('2020-01-01')
const date = new Date('2019-12-31')
expect(component.calcMaxStartDate(date)).toEqual(date)
})
it('should calculate the min end date', () => {
component.minEndDate = new Date('2020-01-01')
component.contractStart = new Date('2020-01-01')
const date = new Date('2020-02-02')
expect(component.calcMinEndDate(date)).toEqual(date)
})