Skip to content

Commit 106fc14

Browse files
author
Gavin Williams
committed
Fix test failures following updates
1 parent f5d5633 commit 106fc14

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/web/src/app/api/(server)/agents/route.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ describe('POST /api/agents', () => {
175175

176176
test('accepts scope REPO when repoIds is a non-empty array', async () => {
177177
prisma.agentConfig.findUnique.mockResolvedValue(null);
178+
prisma.repo.count.mockResolvedValue(1);
178179
prisma.agentConfig.create.mockResolvedValue(makeDbConfig({ scope: AgentScope.REPO }) as any);
179180

180181
const res = await POST(makePostRequest({ name: 'x', type: 'CODE_REVIEW', scope: 'REPO', repoIds: [1] }));
@@ -184,6 +185,7 @@ describe('POST /api/agents', () => {
184185

185186
test('accepts scope CONNECTION when connectionIds is a non-empty array', async () => {
186187
prisma.agentConfig.findUnique.mockResolvedValue(null);
188+
prisma.connection.count.mockResolvedValue(1);
187189
prisma.agentConfig.create.mockResolvedValue(makeDbConfig({ scope: AgentScope.CONNECTION }) as any);
188190

189191
const res = await POST(makePostRequest({ name: 'x', type: 'CODE_REVIEW', scope: 'CONNECTION', connectionIds: [2] }));

0 commit comments

Comments
 (0)