Skip to content

Commit 5fdb0f2

Browse files
committed
Add future negative test to withinCutoff
1 parent 5cf4215 commit 5fdb0f2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

functions/src/events/helpers.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { subDays } from "date-fns"
1+
import { addDays, subDays } from "date-fns"
22
import { withinCutoff } from "./helpers"
33

44
describe("withinCutoff true", () => {
@@ -27,4 +27,13 @@ describe("withinCutoff true", () => {
2727
const result = withinCutoff(threeDaysAgo)
2828
expect(result).toEqual(false)
2929
})
30+
31+
it("should return false for a date that is 2 days in the future", () => {
32+
const now = new Date()
33+
34+
const threeDaysAgo = addDays(now, 2)
35+
36+
const result = withinCutoff(threeDaysAgo)
37+
expect(result).toEqual(false)
38+
})
3039
})

0 commit comments

Comments
 (0)