@@ -341,7 +341,7 @@ apiDescribe.skipClassic('Pipelines', persistence => {
341341 } ) ;
342342
343343 describe ( 'console support' , ( ) => {
344- it ( 'supports internal serialization to proto' , async ( ) => {
344+ it ( 'supports pipeline query serialization to proto' , async ( ) => {
345345 // Perform the same test as the console
346346 const pipeline = firestore
347347 . pipeline ( )
@@ -357,6 +357,104 @@ apiDescribe.skipClassic('Pipelines', persistence => {
357357 ) ;
358358 } ) ;
359359
360+ it ( 'supports PipelineSnapshot serialization to proto' , async ( ) => {
361+ // Perform the same test as the console
362+ const pipeline = firestore
363+ . pipeline ( )
364+ . collection ( randomCol )
365+ . sort ( field ( 'title' ) . ascending ( ) )
366+ . limit ( 1 ) ;
367+
368+ const result = await execute ( pipeline ) ;
369+
370+ expect ( result . results [ 0 ] . _fieldsProto ( ) ) . to . deep . equal ( {
371+ 'author' : {
372+ 'stringValue' : 'George Orwell'
373+ } ,
374+ 'awards' : {
375+ 'mapValue' : {
376+ 'fields' : {
377+ 'prometheus' : {
378+ 'booleanValue' : true
379+ }
380+ }
381+ }
382+ } ,
383+ 'embedding' : {
384+ 'mapValue' : {
385+ 'fields' : {
386+ '__type__' : {
387+ 'stringValue' : '__vector__'
388+ } ,
389+ 'value' : {
390+ 'arrayValue' : {
391+ 'values' : [
392+ {
393+ 'doubleValue' : 1
394+ } ,
395+ {
396+ 'doubleValue' : 1
397+ } ,
398+ {
399+ 'doubleValue' : 1
400+ } ,
401+ {
402+ 'doubleValue' : 1
403+ } ,
404+ {
405+ 'doubleValue' : 1
406+ } ,
407+ {
408+ 'doubleValue' : 1
409+ } ,
410+ {
411+ 'doubleValue' : 1
412+ } ,
413+ {
414+ 'doubleValue' : 10
415+ } ,
416+ {
417+ 'doubleValue' : 1
418+ } ,
419+ {
420+ 'doubleValue' : 1
421+ }
422+ ]
423+ }
424+ }
425+ }
426+ }
427+ } ,
428+ 'genre' : {
429+ 'stringValue' : 'Dystopian'
430+ } ,
431+ 'published' : {
432+ 'integerValue' : '1949'
433+ } ,
434+ 'rating' : {
435+ 'doubleValue' : 4.2
436+ } ,
437+ 'tags' : {
438+ 'arrayValue' : {
439+ 'values' : [
440+ {
441+ 'stringValue' : 'surveillance'
442+ } ,
443+ {
444+ 'stringValue' : 'totalitarianism'
445+ } ,
446+ {
447+ 'stringValue' : 'propaganda'
448+ }
449+ ]
450+ }
451+ } ,
452+ 'title' : {
453+ 'stringValue' : '1984'
454+ }
455+ } ) ;
456+ } ) ;
457+
360458 it ( 'performs validation' , async ( ) => {
361459 expect ( ( ) => {
362460 const pipeline = firestore
0 commit comments