File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
tests/integration/tools/atlas Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -178,7 +178,23 @@ describeWithAtlas("clusters", (integration) => {
178178 } ) ) as CallToolResult ;
179179 expect ( response . content ) . toBeArray ( ) ;
180180 expect ( response . content ) . toHaveLength ( 1 ) ;
181- expect ( response . content [ 0 ] ?. text ) . toContain ( `Connected to cluster "${ clusterName } "` ) ;
181+ expect ( response . content [ 0 ] ?. type ) . toEqual ( "text" ) ;
182+ expect ( response . content [ 0 ] ?. text ) . toContain ( `Connecting to cluster "${ clusterName } "...` ) ;
183+
184+ for ( let i = 0 ; i < 600 ; i ++ ) {
185+ const response = ( await integration . mcpClient ( ) . callTool ( {
186+ name : "atlas-connect-cluster" ,
187+ arguments : { projectId, clusterName } ,
188+ } ) ) as CallToolResult ;
189+ expect ( response . content ) . toBeArray ( ) ;
190+ expect ( response . content ) . toHaveLength ( 1 ) ;
191+ expect ( response . content [ 0 ] ?. type ) . toEqual ( "text" ) ;
192+ const c = response . content [ 0 ] as { text : string } ;
193+ if ( c . text . includes ( "Cluster is already connected." ) ) {
194+ break ; // success
195+ }
196+ await sleep ( 500 ) ;
197+ }
182198 } ) ;
183199 } ) ;
184200 } ) ;
You can’t perform that action at this time.
0 commit comments