test: complete isolated privacy fixtures

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-08-01 22:54:01 +00:00
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"),