fix: File operation cleanup task should also remove import data

This commit is contained in:
Tom Moor
2022-07-25 21:10:37 +01:00
parent 9b837763e6
commit f370b0296b
2 changed files with 7 additions and 11 deletions

View File

@@ -11,11 +11,11 @@ import CleanupExpiredFileOperationsTask from "./CleanupExpiredFileOperationsTask
beforeEach(() => flushdb());
describe("CleanupExpiredFileOperationsTask", () => {
it("should expire exports older than 30 days ago", async () => {
it("should expire exports older than 15 days ago", async () => {
await buildFileOperation({
type: FileOperationType.Export,
state: FileOperationState.Complete,
createdAt: subDays(new Date(), 30),
createdAt: subDays(new Date(), 15),
});
await buildFileOperation({
type: FileOperationType.Export,
@@ -35,11 +35,11 @@ describe("CleanupExpiredFileOperationsTask", () => {
expect(data).toEqual(1);
});
it("should not expire exports made less than 30 days ago", async () => {
it("should not expire exports made less than 15 days ago", async () => {
await buildFileOperation({
type: FileOperationType.Export,
state: FileOperationState.Complete,
createdAt: subDays(new Date(), 29),
createdAt: subDays(new Date(), 14),
});
await buildFileOperation({
type: FileOperationType.Export,