@@ -25,7 +25,7 @@ const pageData = {
2525 {
2626 session_id : 's1' ,
2727 workspace_id : 'ws' ,
28- session_title : '搜索重构 ' ,
28+ session_title : 'Search refactor ' ,
2929 agent_id : 'main' ,
3030 role : 'assistant' ,
3131 snippet : 'Here is the apple guide.' ,
@@ -40,7 +40,7 @@ const pageData = {
4040 session_title : 'title doc' ,
4141 agent_id : '' ,
4242 role : 'title' ,
43- snippet : '苹果询价 ' ,
43+ snippet : 'Apple quote ' ,
4444 time : 1_700_000_100_000 ,
4545 score : 0.9 ,
4646 } ,
@@ -58,7 +58,7 @@ describe('fetchSearchPage', () => {
5858 const page = await fetchSearchPage ( {
5959 baseUrl : 'http://h:1' ,
6060 token : 'tok' ,
61- query : '苹果 ' ,
61+ query : 'apple ' ,
6262 role : 'assistant' ,
6363 sort : 'time_desc' ,
6464 pageSize : 20 ,
@@ -74,7 +74,7 @@ describe('fetchSearchPage', () => {
7474 authorization : 'Bearer tok' ,
7575 } ) ;
7676 expect ( JSON . parse ( calls [ 0 ] ! . init ?. body as string ) ) . toEqual ( {
77- query : '苹果 ' ,
77+ query : 'apple ' ,
7878 role : 'assistant' ,
7979 sort : 'time_desc' ,
8080 page_size : 20 ,
@@ -103,7 +103,7 @@ describe('fetchSearchPage', () => {
103103
104104 it ( 'omits the authorization header when no token is configured' , async ( ) => {
105105 const { calls, fetchImpl } = fakeFetch ( okEnvelope ( pageData ) ) ;
106- await fetchSearchPage ( { baseUrl : 'http://h:1' , query : '苹果 ' , fetchImpl } ) ;
106+ await fetchSearchPage ( { baseUrl : 'http://h:1' , query : 'apple ' , fetchImpl } ) ;
107107 expect ( calls [ 0 ] ! . init ?. headers ) . toEqual ( { 'content-type' : 'application/json' } ) ;
108108 } ) ;
109109
@@ -127,15 +127,15 @@ describe('fetchSearchPage', () => {
127127
128128 it ( 'leaves incomplete undefined for absent or unexpected values' , async ( ) => {
129129 const { fetchImpl } = fakeFetch ( okEnvelope ( pageData ) ) ;
130- const page = await fetchSearchPage ( { baseUrl : 'http://h:1' , query : '苹果 ' , fetchImpl } ) ;
130+ const page = await fetchSearchPage ( { baseUrl : 'http://h:1' , query : 'apple ' , fetchImpl } ) ;
131131 expect ( page . incomplete ) . toBeUndefined ( ) ;
132132
133133 const { fetchImpl : fetchImpl2 } = fakeFetch (
134134 okEnvelope ( { ...pageData , incomplete : 'something_else' } ) ,
135135 ) ;
136136 const page2 = await fetchSearchPage ( {
137137 baseUrl : 'http://h:1' ,
138- query : '苹果 ' ,
138+ query : 'apple ' ,
139139 fetchImpl : fetchImpl2 ,
140140 } ) ;
141141 expect ( page2 . incomplete ) . toBeUndefined ( ) ;
@@ -145,51 +145,51 @@ describe('fetchSearchPage', () => {
145145 const { calls, fetchImpl } = fakeFetch ( okEnvelope ( pageData ) ) ;
146146 await fetchSearchPage ( {
147147 baseUrl : 'http://h:1' ,
148- query : '苹果 ' ,
148+ query : 'apple ' ,
149149 container : { sessionId : 's1' } ,
150150 fetchImpl,
151151 } ) ;
152152 expect ( JSON . parse ( calls [ 0 ] ! . init ?. body as string ) ) . toEqual ( {
153- query : '苹果 ' ,
153+ query : 'apple ' ,
154154 container : { session_id : 's1' } ,
155155 } ) ;
156156
157157 const { calls : calls2 , fetchImpl : fetchImpl2 } = fakeFetch ( okEnvelope ( pageData ) ) ;
158158 await fetchSearchPage ( {
159159 baseUrl : 'http://h:1' ,
160- query : '苹果 ' ,
160+ query : 'apple ' ,
161161 container : { sessionId : 's1' , agentId : 'main' } ,
162162 fetchImpl : fetchImpl2 ,
163163 } ) ;
164164 expect ( JSON . parse ( calls2 [ 0 ] ! . init ?. body as string ) ) . toEqual ( {
165- query : '苹果 ' ,
165+ query : 'apple ' ,
166166 container : { session_id : 's1' , agent_id : 'main' } ,
167167 } ) ;
168168 } ) ;
169169
170170 it ( 'parses source: live and source: index' , async ( ) => {
171171 const { fetchImpl } = fakeFetch ( okEnvelope ( { ...pageData , source : 'live' } ) ) ;
172- const page = await fetchSearchPage ( { baseUrl : 'http://h:1' , query : '苹果 ' , fetchImpl } ) ;
172+ const page = await fetchSearchPage ( { baseUrl : 'http://h:1' , query : 'apple ' , fetchImpl } ) ;
173173 expect ( page . source ) . toBe ( 'live' ) ;
174174
175175 const { fetchImpl : fetchImpl2 } = fakeFetch ( okEnvelope ( { ...pageData , source : 'index' } ) ) ;
176176 const page2 = await fetchSearchPage ( {
177177 baseUrl : 'http://h:1' ,
178- query : '苹果 ' ,
178+ query : 'apple ' ,
179179 fetchImpl : fetchImpl2 ,
180180 } ) ;
181181 expect ( page2 . source ) . toBe ( 'index' ) ;
182182 } ) ;
183183
184184 it ( 'leaves source undefined for absent or unknown values' , async ( ) => {
185185 const { fetchImpl } = fakeFetch ( okEnvelope ( pageData ) ) ;
186- const page = await fetchSearchPage ( { baseUrl : 'http://h:1' , query : '苹果 ' , fetchImpl } ) ;
186+ const page = await fetchSearchPage ( { baseUrl : 'http://h:1' , query : 'apple ' , fetchImpl } ) ;
187187 expect ( page . source ) . toBeUndefined ( ) ;
188188
189189 const { fetchImpl : fetchImpl2 } = fakeFetch ( okEnvelope ( { ...pageData , source : 'whatever' } ) ) ;
190190 const page2 = await fetchSearchPage ( {
191191 baseUrl : 'http://h:1' ,
192- query : '苹果 ' ,
192+ query : 'apple ' ,
193193 fetchImpl : fetchImpl2 ,
194194 } ) ;
195195 expect ( page2 . source ) . toBeUndefined ( ) ;
0 commit comments