File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
src/adapter/search-response-adapter Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ function adaptSnippet(
104104 attributesToSnippet = attributesToSnippet . map (
105105 ( attribute ) => attribute . split ( ':' ) [ 0 ]
106106 ) as any [ ]
107- const snippetAll = attributesToSnippet . includes ( '*' ) ;
107+ const snippetAll = attributesToSnippet . includes ( '*' )
108108 // formattedHit is the `_formatted` object returned by MeiliSearch.
109109 // It contains all the highlighted and croped attributes
110110 return ( Object . keys ( formattedHit ) as any [ ] ) . reduce ( ( result , key ) => {
Original file line number Diff line number Diff line change @@ -63,11 +63,15 @@ describe('Snippet Browser test', () => {
6363 const highlighted = response . results [ 0 ] ?. hits [ 0 ] ?. _highlightResult
6464 const snippeted = response . results [ 0 ] . hits [ 0 ] . _snippetResult
6565 expect ( highlighted ?. id ?. value ) . toEqual ( '6' )
66- expect ( highlighted ?. title ?. value ) . toEqual ( '__ais-highlight__Judg__/ais-highlight__ment Night' )
66+ expect ( highlighted ?. title ?. value ) . toEqual (
67+ '__ais-highlight__Judg__/ais-highlight__ment Night'
68+ )
6769 expect ( highlighted ?. overview ?. value ) . toEqual ( 'While' )
6870 expect ( highlighted ?. release_date ?. value ) . toEqual ( '750643200' )
6971 expect ( snippeted ?. id ?. value ) . toEqual ( '6' )
70- expect ( snippeted ?. title ?. value ) . toEqual ( '__ais-highlight__Judg__/ais-highlight__ment Night...' )
72+ expect ( snippeted ?. title ?. value ) . toEqual (
73+ '__ais-highlight__Judg__/ais-highlight__ment Night...'
74+ )
7175 expect ( snippeted ?. overview ?. value ) . toEqual ( 'While...' )
7276 expect ( snippeted ?. release_date ?. value ) . toEqual ( '750643200' )
7377 } )
You can’t perform that action at this time.
0 commit comments