Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
unit(post): update the tests to consider date time range
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Nov 14, 2022
1 parent 2a9b574 commit 498069d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions routes/api/post/list.get.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ describe("Controller: GET /api/post", () => {
requester.customizeRequest({
"query": {
"filter": {
"dateTimeRange": {
"begin": new Date(),
"end": new Date(Date.now() + 2)
},
"existence": "*"
}
}
Expand All @@ -42,7 +46,8 @@ describe("Controller: GET /api/post", () => {
await requester.runMiddleware(queryValidationFunction)

const body = requester.expectFailure(ErrorBag).toJSON()
expect(body).toHaveLength(1)
expect(body).toHaveProperty("0.source.parameter", "filter.existence")
expect(body).toHaveLength(2)
expect(body).toHaveProperty("0.source.parameter", "filter.dateTimeRange")
expect(body).toHaveProperty("1.source.parameter", "filter.existence")
})
})

0 comments on commit 498069d

Please sign in to comment.