mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-27 11:20:42 +01:00
test: complete isolated privacy fixtures
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
126f968b68
commit
4e4e51e761
2 files changed
+16
-1
No files matched your search
@@ -1183,6 +1183,11 @@ describeEmbeddedPostgres("heartbeat orphaned process recovery", () => {
|
||||
startedAt: now,
|
||||
});
|
||||
|
||||
// Complete the circular issue/run fixture after both FK targets exist.
|
||||
await db.update(heartbeatRuns)
|
||||
.set({ scopeKind: "issue", issueId })
|
||||
.where(eq(heartbeatRuns.id, runId));
|
||||
|
||||
return { companyId, agentId, runId, wakeupRequestId, issueId };
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,17 @@ function registerModuleMocks() {
|
||||
}));
|
||||
}
|
||||
|
||||
async function createApp(db: unknown = {}) {
|
||||
function createEmptyRelationReadDb() {
|
||||
const query = {
|
||||
from: vi.fn().mockReturnThis(),
|
||||
where: vi.fn(async () => []),
|
||||
};
|
||||
return {
|
||||
select: vi.fn().mockReturnValue(query),
|
||||
};
|
||||
}
|
||||
|
||||
async function createApp(db: unknown = createEmptyRelationReadDb()) {
|
||||
const [{ issueRoutes }, { errorHandler }] = await Promise.all([
|
||||
vi.importActual<typeof import("../routes/issues.js")>("../routes/issues.js"),
|
||||
vi.importActual<typeof import("../middleware/index.js")>("../middleware/index.js"),
|
||||
|
||||
Reference in new issue
Block a user