@@ -51,7 +51,8 @@ describe( 'Simple item search', () => {
5151 } ) ;
5252
5353 it ( 'finds items matching the search term' , async ( ) => {
54- const response = await newSearchRequest ( 'en' , englishTermMatchingTwoItems )
54+ const language = 'en' ;
55+ const response = await newSearchRequest ( language , englishTermMatchingTwoItems )
5556 . assertValidRequest ( )
5657 . makeRequest ( ) ;
5758
@@ -61,22 +62,32 @@ describe( 'Simple item search', () => {
6162 assert . lengthOf ( results , 2 ) ;
6263
6364 const item1Result = results . find ( ( { id } ) => id === item1 . id ) ;
64- assert . deepEqual ( item1Result , { id : item1 . id , label : item1Label , description : item1Description } ) ;
65+ assert . deepEqual ( item1Result , {
66+ id : item1 . id ,
67+ label : { language, value : item1Label } ,
68+ description : { language, value : item1Description }
69+ } ) ;
6570
6671 const item2Result = results . find ( ( { id } ) => id === item2 . id ) ;
67- assert . deepEqual ( item2Result , { id : item2 . id , label : item2Label , description : item2Description } ) ;
72+ assert . deepEqual ( item2Result , {
73+ id : item2 . id ,
74+ label : { language, value : item2Label } ,
75+ description : { language, value : item2Description }
76+ } ) ;
6877 } ) ;
6978
7079 it ( 'finds items matching the search term in another language' , async ( ) => {
71- const response = await newSearchRequest ( 'de' , item1GermanLabel )
80+ const language = 'de' ;
81+ const response = await newSearchRequest ( language , item1GermanLabel )
7282 . assertValidRequest ( )
7383 . makeRequest ( ) ;
7484
7585 expect ( response ) . to . have . status ( 200 ) ;
76- assert . deepEqual (
77- response . body . results ,
78- [ { id : item1 . id , label : item1GermanLabel , description : item1GermanDescription } ]
79- ) ;
86+ assert . deepEqual ( response . body . results , [ {
87+ id : item1 . id ,
88+ label : { language, value : item1GermanLabel } ,
89+ description : { language, value : item1GermanDescription }
90+ } ] ) ;
8091 } ) ;
8192
8293 it ( 'finds nothing if no items match' , async ( ) => {
0 commit comments