File tree Expand file tree Collapse file tree 2 files changed +57
-1
lines changed
packages/mcp-server-supabase Expand file tree Collapse file tree 2 files changed +57
-1
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ async function setup(options: SetupOptions = {}) {
85
85
const [ textContent ] = content ;
86
86
87
87
if ( ! textContent ) {
88
- throw new Error ( 'tool result content is missing' ) ;
88
+ return undefined ;
89
89
}
90
90
91
91
if ( textContent . type !== 'text' ) {
@@ -215,6 +215,32 @@ describe('tools', () => {
215
215
} ) ;
216
216
} ) ;
217
217
218
+ test ( 'pause project' , async ( ) => {
219
+ const { callTool } = await setup ( ) ;
220
+ const project = mockProjects . values ( ) . next ( ) . value ! ;
221
+ await callTool ( {
222
+ name : 'pause_project' ,
223
+ arguments : {
224
+ project_id : project . id ,
225
+ } ,
226
+ } ) ;
227
+
228
+ expect ( project . status ) . toEqual ( 'INACTIVE' ) ;
229
+ } ) ;
230
+
231
+ test ( 'restore project' , async ( ) => {
232
+ const { callTool } = await setup ( ) ;
233
+ const project = mockProjects . values ( ) . next ( ) . value ! ;
234
+ await callTool ( {
235
+ name : 'restore_project' ,
236
+ arguments : {
237
+ project_id : project . id ,
238
+ } ,
239
+ } ) ;
240
+
241
+ expect ( project . status ) . toEqual ( 'ACTIVE_HEALTHY' ) ;
242
+ } ) ;
243
+
218
244
test ( 'get project url' , async ( ) => {
219
245
const { callTool } = await setup ( ) ;
220
246
const project = mockProjects . values ( ) . next ( ) . value ! ;
Original file line number Diff line number Diff line change @@ -98,6 +98,36 @@ export const mockManagementApi = [
98
98
return HttpResponse . json ( projectResponse ) ;
99
99
} ) ,
100
100
101
+ http . post < { projectId : string } > (
102
+ `${ API_URL } /v1/projects/:projectId/pause` ,
103
+ ( { params } ) => {
104
+ const project = mockProjects . get ( params . projectId ) ;
105
+ if ( ! project ) {
106
+ return HttpResponse . json (
107
+ { error : 'Project not found' } ,
108
+ { status : 404 }
109
+ ) ;
110
+ }
111
+ project . status = 'INACTIVE' ;
112
+ return HttpResponse . json ( project . details ) ;
113
+ }
114
+ ) ,
115
+
116
+ http . post < { projectId : string } > (
117
+ `${ API_URL } /v1/projects/:projectId/restore` ,
118
+ ( { params } ) => {
119
+ const project = mockProjects . get ( params . projectId ) ;
120
+ if ( ! project ) {
121
+ return HttpResponse . json (
122
+ { error : 'Project not found' } ,
123
+ { status : 404 }
124
+ ) ;
125
+ }
126
+ project . status = 'ACTIVE_HEALTHY' ;
127
+ return HttpResponse . json ( project . details ) ;
128
+ }
129
+ ) ,
130
+
101
131
http . get ( `${ API_URL } /v1/organizations` , ( ) => {
102
132
return HttpResponse . json ( mockOrgs ) ;
103
133
} ) ,
You can’t perform that action at this time.
0 commit comments