77 validateThrowsForInvalidArguments ,
88 databaseCollectionInvalidArgs ,
99 sleep ,
10+ getDataFromUntrustedContent ,
1011} from "../../../helpers.js" ;
1112import type { NodeDriverServiceProvider } from "@mongosh/service-provider-node-driver" ;
1213import type { SearchIndexStatus } from "../../../../../src/tools/mongodb/search/listSearchIndexes.js" ;
@@ -54,7 +55,9 @@ describeWithMongoDB(
5455 name : "list-search-indexes" ,
5556 arguments : { database : "any" , collection : "foo" } ,
5657 } ) ;
57- const content = getResponseContent ( response . content ) ;
58+ const responseContent = getResponseContent ( response . content ) ;
59+ const content = getDataFromUntrustedContent ( responseContent ) ;
60+ expect ( responseContent ) . toContain ( "Could not retrieve search indexes" ) ;
5861 expect ( content ) . toEqual ( "There are no search or vector search indexes in any.foo" ) ;
5962 } ) ;
6063 } ) ;
@@ -65,7 +68,9 @@ describeWithMongoDB(
6568 name : "list-search-indexes" ,
6669 arguments : { database : "any" , collection : "foo" } ,
6770 } ) ;
68- const content = getResponseContent ( response . content ) ;
71+ const responseContent = getResponseContent ( response . content ) ;
72+ const content = getDataFromUntrustedContent ( responseContent ) ;
73+ expect ( responseContent ) . toContain ( "Could not retrieve search indexes" ) ;
6974 expect ( content ) . toEqual ( "There are no search or vector search indexes in any.foo" ) ;
7075 } ) ;
7176 } ) ;
0 commit comments