Skip to content

Commit

Permalink
fix: correct tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainLanz committed Aug 24, 2023
1 parent c24981f commit e15605d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/validations/after-or-equal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,9 @@ test.group('Date | After Or Equal | Ref', () => {
const reporter = new ApiErrorReporter(new MessagesBag({}), false)
const afterDate = DateTime.local().plus({ days: 11 }).toISODate()

/*
/*
Using toISO because toISODate will not include hours, minutes, seconds, ...
So if later when it get converted to datetime again, the test will fail
So if later when it get converted to datetime again, the test will fail
because `publishedAtSameDate` would then have 0 in hours, minutes, seconds, ... but datetime in ref is not.
*/
const sameDate = DateTime.local().plus({ days: 10 }).plus({ hour: 1 }).toISO()
Expand All @@ -471,13 +471,13 @@ test.group('Date | After Or Equal | Ref', () => {
}

afterOrEqual.validate(
DateTime.fromISO(afterDate),
DateTime.fromISO(afterDate!),
compile(validator.refs.afterDate).compiledOptions!,
validator
)

afterOrEqual.validate(
DateTime.fromISO(sameDate),
DateTime.fromISO(sameDate!),
compile(validator.refs.afterDate).compiledOptions!,
validator
)
Expand Down

0 comments on commit e15605d

Please sign in to comment.