Skip to content

Commit 3b03904

Browse files
committed
Add negative test for video scrape within cutoff check
1 parent c35ec01 commit 3b03904

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,7 +1,7 @@
11
import { subDays } from "date-fns"
22
import { withinCutoff } from "./helpers"
33

4-
describe("withinCutoff", () => {
4+
describe("withinCutoff true", () => {
55
beforeEach(() => {
66
jest.useFakeTimers()
77
})
@@ -18,4 +18,13 @@ describe("withinCutoff", () => {
1818
const result = withinCutoff(threeDaysAgo)
1919
expect(result).toEqual(true)
2020
})
21+
22+
it("should return false for a date that is 9 days ago", () => {
23+
const now = new Date()
24+
25+
const threeDaysAgo = subDays(now, 9)
26+
27+
const result = withinCutoff(threeDaysAgo)
28+
expect(result).toEqual(false)
29+
})
2130
})

0 commit comments

Comments
 (0)