Skip to content

Commit

Permalink
feat(COOP-2237): add test for minDate
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarinkov committed Aug 12, 2024
1 parent ab26bdb commit 49ef7f1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/validators/src/date.validator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isAfter, isBefore, isDate } from './date.validators'
import { isAfter, isBefore, isDate, isMinDate } from './date.validators'

const aDate = new Date(2000, 0, 1)
const aDateString = '2000-01-01'
Expand Down Expand Up @@ -36,4 +36,13 @@ describe('date', () => {
expect(isAfter(aDate)(null)).toBe(true)
expect(isAfter(aDate)('')).toBe(true)
})
test('isMinDate', () => {
expect(isMinDate(aDate)(aDate)).toBe(true)
expect(isMinDate(aDateString)(aDate)).toBe(true)
expect(isMinDate(oldDate)(aDate)).toBe(true)
expect(isMinDate(oldDate)(aDateString)).toBe(true)
expect(isMinDate(aDate)(oldDate)).toBe(false)
expect(isMinDate(aDate)(null)).toBe(true)
expect(isMinDate(aDate)('')).toBe(true)
})
})

0 comments on commit 49ef7f1

Please sign in to comment.