Skip to content

Commit 1b17bf4

Browse files
committed
feat: test enabling branching twice
1 parent d6a4b21 commit 1b17bf4

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

packages/mcp-server-supabase/src/server.test.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,36 @@ describe('tools', () => {
454454
});
455455
});
456456

457+
test('enabling branching twice returns the same main branch', async () => {
458+
const { callTool } = await setup();
459+
const project = mockProjects.values().next().value!;
460+
461+
const firstResult = await callTool({
462+
name: 'enable_branching',
463+
arguments: {
464+
project_id: project.id,
465+
},
466+
});
467+
468+
const secondResult = await callTool({
469+
name: 'enable_branching',
470+
arguments: {
471+
project_id: project.id,
472+
},
473+
});
474+
475+
const listResult = await callTool({
476+
name: 'list_branches',
477+
arguments: {
478+
project_id: project.id,
479+
},
480+
});
481+
482+
expect(listResult.length).toBe(1);
483+
expect(listResult[0]).toEqual(firstResult);
484+
expect(firstResult).toEqual(secondResult);
485+
});
486+
457487
test('create branch', async () => {
458488
const { callTool } = await setup();
459489
const project = mockProjects.values().next().value!;

0 commit comments

Comments
 (0)