@@ -343,28 +343,45 @@ describe.each([{ vectorSearchEnabled: false }, { vectorSearchEnabled: true }])(
343343 ( integration ) => {
344344 const { getIndexName } = setupForVectorSearchIndexes ( integration ) ;
345345
346- describe ( "and attempting to delete a non-existent index" , ( ) => {
347- it ( "should fail with appropriate error" , async ( ) => {
348- const response = await integration . mcpClient ( ) . callTool ( {
349- name : "drop-index" ,
350- arguments : {
351- database : "any" ,
352- collection : "foo" ,
353- indexName : "non-existent" ,
354- type : "search" ,
355- } ,
356- } ) ;
357- expect ( response . isError ) . toBe ( true ) ;
358- const content = getResponseContent ( response . content ) ;
359- expect ( content ) . toContain ( "Index does not exist in the provided namespace." ) ;
346+ describe . each ( [
347+ {
348+ title : "an index from non-existent database" ,
349+ database : "non-existent-db" ,
350+ collection : "non-existent-coll" ,
351+ indexName : "non-existent-index" ,
352+ } ,
353+ {
354+ title : "an index from non-existent collection" ,
355+ database : "mflix" ,
356+ collection : "non-existent-coll" ,
357+ indexName : "non-existent-index" ,
358+ } ,
359+ {
360+ title : "a non-existent index" ,
361+ database : "mflix" ,
362+ collection : "movies" ,
363+ indexName : "non-existent-index" ,
364+ } ,
365+ ] ) (
366+ "and attempting to delete $title (namespace - $database $collection)" ,
367+ ( { database, collection, indexName } ) => {
368+ it ( "should fail with appropriate error" , async ( ) => {
369+ const response = await integration . mcpClient ( ) . callTool ( {
370+ name : "drop-index" ,
371+ arguments : { database, collection, indexName, type : "search" } ,
372+ } ) ;
373+ expect ( response . isError ) . toBe ( true ) ;
374+ const content = getResponseContent ( response . content ) ;
375+ expect ( content ) . toContain ( "Index does not exist in the provided namespace." ) ;
360376
361- const data = getDataFromUntrustedContent ( content ) ;
362- expect ( JSON . parse ( data ) ) . toMatchObject ( {
363- indexName : "non-existent" ,
364- namespace : "any.foo" ,
377+ const data = getDataFromUntrustedContent ( content ) ;
378+ expect ( JSON . parse ( data ) ) . toMatchObject ( {
379+ indexName,
380+ namespace : `${ database } .${ collection } ` ,
381+ } ) ;
365382 } ) ;
366- } ) ;
367- } ) ;
383+ }
384+ ) ;
368385
369386 describe ( "and attempting to delete an existing index" , ( ) => {
370387 it ( "should succeed in deleting the index" , async ( ) => {
0 commit comments