@@ -1339,6 +1339,43 @@ describe('generative search', () => {
13391339
13401340 expect ( mockClient . query ) . toHaveBeenCalledWith ( expectedQuery ) ;
13411341 } ) ;
1342+
1343+ test ( 'groupedTask with properties' , ( ) => {
1344+ const expectedQuery =
1345+ '{Get{Mammal{name taxonomy _additional{generate(groupedResult:' +
1346+ '{task:"Explain why platypi can lay eggs",properties:["title","description"]}){error groupedResult}}}}}' ;
1347+
1348+ new Getter ( mockClient )
1349+ . withClassName ( 'Mammal' )
1350+ . withGenerate ( {
1351+ groupedTask : 'Explain why platypi can lay eggs' ,
1352+ groupedProperties : [ 'title' , 'description' ] ,
1353+ } )
1354+ . withFields ( 'name taxonomy' )
1355+ . do ( ) ;
1356+
1357+ expect ( mockClient . query ) . toHaveBeenCalledWith ( expectedQuery ) ;
1358+ } ) ;
1359+
1360+ test ( 'single prompt and grouped task with properties' , ( ) => {
1361+ const expectedQuery =
1362+ '{Get{Mammal{name taxonomy _additional{generate(singleResult:' +
1363+ '{prompt:"How tall is a baby giraffe?"}groupedResult:{task:' +
1364+ '"Explain how the heights of mammals relate to their prefferred food sources",properties:["property"]})' +
1365+ '{error singleResult groupedResult}}}}}' ;
1366+
1367+ new Getter ( mockClient )
1368+ . withClassName ( 'Mammal' )
1369+ . withFields ( 'name taxonomy' )
1370+ . withGenerate ( {
1371+ singlePrompt : 'How tall is a baby giraffe?' ,
1372+ groupedTask : 'Explain how the heights of mammals relate to their prefferred food sources' ,
1373+ groupedProperties : [ 'property' ] ,
1374+ } )
1375+ . do ( ) ;
1376+
1377+ expect ( mockClient . query ) . toHaveBeenCalledWith ( expectedQuery ) ;
1378+ } ) ;
13421379} ) ;
13431380
13441381describe ( 'groupBy valid searchers' , ( ) => {
0 commit comments