test(repositories): cover heartbeat repository context fixture

Provide repository access and authorization seams in the goal-context route fixture and assert the assigned agent's effective repository payload.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-08-12 02:34:33 +00:00
1 parent 4dafea4e79
commit e973924dfb
1 file changed
+10
@@ -131,6 +131,12 @@ vi.mock("../services/index.js", () => ({
issueService: () => mockIssueService,
logActivity: mockLogActivity,
projectService: () => mockProjectService,
repositoryAccessService: () => ({
listEffectiveRepositories: vi.fn(async () => []),
}),
authorizationService: () => ({
decide: vi.fn(async () => ({ allowed: true })),
}),
routineService: () => mockRoutineService,
workProductService: () => mockWorkProductService,
}));
@@ -436,6 +442,10 @@ describe.sequential("issue goal context routes", () => {
expect(res.status).toBe(200);
expect(res.body.issue.goalId).toBe(projectGoal.id);
expect(res.body.issue.workMode).toBe("planning");
expect(res.body.agent).toEqual({
id: legacyProjectLinkedIssue.assigneeAgentId,
effectiveRepositories: [],
});
expect(res.body.goal).toEqual(
expect.objectContaining({
id: projectGoal.id,