@@ -2657,7 +2657,7 @@ describe('Collection', function () {
26572657 } ) ;
26582658 } ) ;
26592659
2660- context ( 'with options' , function ( ) {
2660+ context ( 'with definition options' , function ( ) {
26612661 it ( 'calls serviceProvider.createIndexes' , async function ( ) {
26622662 await collection . createSearchIndex ( { mappings : { dynamic : true } } ) ;
26632663
@@ -2669,7 +2669,7 @@ describe('Collection', function () {
26692669 } ) ;
26702670 } ) ;
26712671
2672- context ( 'with name, options' , function ( ) {
2672+ context ( 'with name, definition options' , function ( ) {
26732673 it ( 'calls serviceProvider.createIndexes' , async function ( ) {
26742674 await collection . createSearchIndex ( 'my-index' , {
26752675 mappings : { dynamic : true } ,
@@ -2683,7 +2683,7 @@ describe('Collection', function () {
26832683 } ) ;
26842684 } ) ;
26852685
2686- context ( 'with name, options and type !== search' , function ( ) {
2686+ context ( 'with name, definition options and type !== search' , function ( ) {
26872687 it ( 'calls serviceProvider.createSearchIndexes' , async function ( ) {
26882688 await collection . createSearchIndex ( 'my-index' , 'vectorSearch' , {
26892689 mappings : { dynamic : true } ,
@@ -2703,7 +2703,7 @@ describe('Collection', function () {
27032703 } ) ;
27042704 } ) ;
27052705
2706- context ( 'with name, options and type === search' , function ( ) {
2706+ context ( 'with name, definition options and type === search' , function ( ) {
27072707 it ( 'calls serviceProvider.createSearchIndexes' , async function ( ) {
27082708 await collection . createSearchIndex ( 'my-index' , 'search' , {
27092709 mappings : { dynamic : true } ,
@@ -2717,7 +2717,7 @@ describe('Collection', function () {
27172717 } ) ;
27182718 } ) ;
27192719
2720- context ( 'with options and type but no name' , function ( ) {
2720+ context ( 'with definition options and type but no name' , function ( ) {
27212721 it ( 'calls serviceProvider.createSearchIndexes' , async function ( ) {
27222722 await collection . createSearchIndex (
27232723 { mappings : { dynamic : true } } ,
@@ -2737,6 +2737,30 @@ describe('Collection', function () {
27372737 ) ;
27382738 } ) ;
27392739 } ) ;
2740+
2741+ context ( 'with description options' , function ( ) {
2742+ it ( 'calls serviceProvider.createSearchIndexes' , async function ( ) {
2743+ await collection . createSearchIndex ( {
2744+ name : 'my-index' ,
2745+ type : 'vectorSearch' ,
2746+ definition : {
2747+ mappings : { dynamic : true } ,
2748+ } ,
2749+ } ) ;
2750+
2751+ expect ( serviceProvider . createSearchIndexes ) . to . have . been . calledWith (
2752+ 'db1' ,
2753+ 'coll1' ,
2754+ [
2755+ {
2756+ name : 'my-index' ,
2757+ type : 'vectorSearch' ,
2758+ definition : { mappings : { dynamic : true } } ,
2759+ } ,
2760+ ]
2761+ ) ;
2762+ } ) ;
2763+ } ) ;
27402764 } ) ;
27412765
27422766 describe ( 'createSearchIndexes' , function ( ) {
0 commit comments