File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
packages/instant-meilisearch/src/adapter/search-response-adapter/__tests__ Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -49,4 +49,29 @@ describe('Geopoint adapter', () => {
4949 expect ( adaptedHits [ 1 ] . _formatted . _geoloc ) . toBeUndefined ( )
5050 expect ( adaptedHits [ 1 ] . _formatted . _geo ) . toBeUndefined ( )
5151 } )
52+
53+ test ( 'hits with _geoloc field should have randomly generated `objectID` property' , ( ) => {
54+ const hits = [
55+ {
56+ id : 2 ,
57+ _geo : {
58+ lat : 1 ,
59+ lng : 2 ,
60+ } ,
61+ _formatted : {
62+ _geo : {
63+ lat : 1 ,
64+ lng : 2 ,
65+ } ,
66+ } ,
67+ } ,
68+ ]
69+
70+ const adaptedHits = adaptGeoResponse ( hits )
71+
72+ expect ( adaptedHits [ 0 ] ) . toHaveProperty ( '_geoloc' )
73+ expect ( adaptedHits [ 0 ] ) . toHaveProperty ( '_geo' )
74+ expect ( adaptedHits [ 0 ] ) . toHaveProperty ( 'objectID' )
75+ expect ( typeof adaptedHits [ 0 ] . objectID === 'string' ) . toBeTruthy ( )
76+ } )
5277} )
You can’t perform that action at this time.
0 commit comments