File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/instant-meilisearch/src/adapter/search-response-adapter/__tests__ Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,10 @@ describe('Geopoint adapter', () => {
5050 expect ( adaptedHits [ 1 ] . _formatted . _geo ) . toBeUndefined ( )
5151 } )
5252
53- test ( 'hits with _geoloc field should have randomly generated `objectID` property' , ( ) => {
53+ test ( 'hits with _geoloc field should not overwrite `objectID` property' , ( ) => {
5454 const hits = [
5555 {
56+ objectID : '2' ,
5657 id : 2 ,
5758 _geo : {
5859 lat : 1 ,
@@ -69,9 +70,8 @@ describe('Geopoint adapter', () => {
6970
7071 const adaptedHits = adaptGeoResponse ( hits )
7172
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 ( )
73+ expect ( adaptedHits [ 0 ] . _geoloc ) . toEqual ( hits [ 0 ] . _geo )
74+ expect ( adaptedHits [ 0 ] . _geo ) . toEqual ( hits [ 0 ] . _geo )
75+ expect ( adaptedHits [ 0 ] . objectID ) . toEqual ( hits [ 0 ] . objectID )
7676 } )
7777} )
You can’t perform that action at this time.
0 commit comments