Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+14
-14
@@ -2,7 +2,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
type WorkflowExecutionDbTestMocks = {
|
||||
findMany: ReturnType<typeof vi.fn>;
|
||||
findFirstOrThrow: ReturnType<typeof vi.fn>;
|
||||
findFirst: ReturnType<typeof vi.fn>;
|
||||
updateMany: ReturnType<typeof vi.fn>;
|
||||
count: ReturnType<typeof vi.fn>;
|
||||
};
|
||||
@@ -11,7 +11,7 @@ function getDbMocks(): WorkflowExecutionDbTestMocks {
|
||||
const store = globalThis as typeof globalThis & { __workflowExecutionDbTestMocks__?: WorkflowExecutionDbTestMocks };
|
||||
store.__workflowExecutionDbTestMocks__ ??= {
|
||||
findMany: vi.fn(),
|
||||
findFirstOrThrow: vi.fn(),
|
||||
findFirst: vi.fn(),
|
||||
updateMany: vi.fn(),
|
||||
count: vi.fn(),
|
||||
};
|
||||
@@ -22,7 +22,7 @@ vi.mock("~/utils/db.server", () => ({
|
||||
db: {
|
||||
workflowExecution: {
|
||||
findMany: getDbMocks().findMany,
|
||||
findFirstOrThrow: getDbMocks().findFirstOrThrow,
|
||||
findFirst: getDbMocks().findFirst,
|
||||
updateMany: getDbMocks().updateMany,
|
||||
count: getDbMocks().count,
|
||||
},
|
||||
@@ -37,7 +37,7 @@ describe("workflow execution filters", () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
dbMocks.findMany.mockResolvedValue([]);
|
||||
dbMocks.findFirstOrThrow.mockResolvedValue({ id: "execution_1", tenantId: "tenant_1" });
|
||||
dbMocks.findFirst.mockResolvedValue({ id: "execution_1", tenantId: "tenant_1" });
|
||||
dbMocks.updateMany.mockResolvedValue({ count: 1 });
|
||||
dbMocks.count.mockResolvedValue(0);
|
||||
});
|
||||
@@ -65,7 +65,7 @@ describe("workflow execution filters", () => {
|
||||
status: "running",
|
||||
type: "api",
|
||||
},
|
||||
}),
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
@@ -99,7 +99,7 @@ describe("workflow execution filters", () => {
|
||||
},
|
||||
},
|
||||
}),
|
||||
}),
|
||||
})
|
||||
);
|
||||
const query = dbMocks.findMany.mock.calls[0][0];
|
||||
expect(query).not.toHaveProperty("include");
|
||||
@@ -112,7 +112,7 @@ describe("workflow execution filters", () => {
|
||||
tenantId: "tenant_1",
|
||||
appliesToAllTenants: false,
|
||||
},
|
||||
}),
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
@@ -122,11 +122,11 @@ describe("workflow execution filters", () => {
|
||||
{ tenantId: "tenant_1" },
|
||||
{
|
||||
status: "success",
|
||||
output: "{\"ok\":true}",
|
||||
output: '{"ok":true}',
|
||||
duration: 12,
|
||||
error: null,
|
||||
waitingBlockId: null,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
expect(dbMocks.updateMany).toHaveBeenCalledWith(
|
||||
@@ -134,17 +134,17 @@ describe("workflow execution filters", () => {
|
||||
where: { id: "execution_1", tenantId: "tenant_1" },
|
||||
data: expect.objectContaining({
|
||||
status: "success",
|
||||
output: "{\"ok\":true}",
|
||||
output: '{"ok":true}',
|
||||
duration: 12,
|
||||
error: null,
|
||||
waitingBlockId: null,
|
||||
}),
|
||||
}),
|
||||
})
|
||||
);
|
||||
expect(dbMocks.findFirstOrThrow).toHaveBeenCalledWith(
|
||||
expect(dbMocks.findFirst).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
where: { id: "execution_1", tenantId: "tenant_1" },
|
||||
}),
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
@@ -154,7 +154,7 @@ describe("workflow execution filters", () => {
|
||||
expect(dbMocks.findMany).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
where: { workflowId: "workflow_global", tenantId: null },
|
||||
}),
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user