@@ -72,7 +72,7 @@ describe("useChartData", () => {
7272 } ) ;
7373
7474 describe ( "format selection" , ( ) => {
75- test ( "uses JSON format when explicitly specified" , ( ) => {
75+ test ( "uses JSON_ARRAY format when explicitly specified" , ( ) => {
7676 mockUseAnalyticsQuery . mockReturnValue ( {
7777 data : [ ] ,
7878 loading : false ,
@@ -82,18 +82,18 @@ describe("useChartData", () => {
8282 renderHook ( ( ) =>
8383 useChartData ( {
8484 queryKey : "test" ,
85- format : "json " ,
85+ format : "json_array " ,
8686 } ) ,
8787 ) ;
8888
8989 expect ( mockUseAnalyticsQuery ) . toHaveBeenCalledWith (
9090 "test" ,
9191 undefined ,
92- expect . objectContaining ( { format : "JSON " } ) ,
92+ expect . objectContaining ( { format : "JSON_ARRAY " } ) ,
9393 ) ;
9494 } ) ;
9595
96- test ( "uses ARROW format when explicitly specified" , ( ) => {
96+ test ( "uses ARROW_STREAM format when explicitly specified" , ( ) => {
9797 mockUseAnalyticsQuery . mockReturnValue ( {
9898 data : [ ] ,
9999 loading : false ,
@@ -103,18 +103,18 @@ describe("useChartData", () => {
103103 renderHook ( ( ) =>
104104 useChartData ( {
105105 queryKey : "test" ,
106- format : "arrow " ,
106+ format : "arrow_stream " ,
107107 } ) ,
108108 ) ;
109109
110110 expect ( mockUseAnalyticsQuery ) . toHaveBeenCalledWith (
111111 "test" ,
112112 undefined ,
113- expect . objectContaining ( { format : "ARROW " } ) ,
113+ expect . objectContaining ( { format : "ARROW_STREAM " } ) ,
114114 ) ;
115115 } ) ;
116116
117- test ( "auto-selects ARROW for large limit" , ( ) => {
117+ test ( "auto-selects ARROW_STREAM for large limit" , ( ) => {
118118 mockUseAnalyticsQuery . mockReturnValue ( {
119119 data : [ ] ,
120120 loading : false ,
@@ -132,11 +132,11 @@ describe("useChartData", () => {
132132 expect ( mockUseAnalyticsQuery ) . toHaveBeenCalledWith (
133133 "test" ,
134134 { limit : 1000 } ,
135- expect . objectContaining ( { format : "ARROW " } ) ,
135+ expect . objectContaining ( { format : "ARROW_STREAM " } ) ,
136136 ) ;
137137 } ) ;
138138
139- test ( "auto-selects ARROW for date range queries" , ( ) => {
139+ test ( "auto-selects ARROW_STREAM for date range queries" , ( ) => {
140140 mockUseAnalyticsQuery . mockReturnValue ( {
141141 data : [ ] ,
142142 loading : false ,
@@ -157,7 +157,7 @@ describe("useChartData", () => {
157157 expect ( mockUseAnalyticsQuery ) . toHaveBeenCalledWith (
158158 "test" ,
159159 expect . objectContaining ( { startDate : "2025-01-01" } ) ,
160- expect . objectContaining ( { format : "ARROW " } ) ,
160+ expect . objectContaining ( { format : "ARROW_STREAM " } ) ,
161161 ) ;
162162 } ) ;
163163
@@ -179,7 +179,7 @@ describe("useChartData", () => {
179179 expect ( mockUseAnalyticsQuery ) . toHaveBeenCalledWith (
180180 "test" ,
181181 expect . anything ( ) ,
182- expect . objectContaining ( { format : "JSON " } ) ,
182+ expect . objectContaining ( { format : "JSON_ARRAY " } ) ,
183183 ) ;
184184 } ) ;
185185
@@ -201,11 +201,11 @@ describe("useChartData", () => {
201201 expect ( mockUseAnalyticsQuery ) . toHaveBeenCalledWith (
202202 "test" ,
203203 expect . anything ( ) ,
204- expect . objectContaining ( { format : "ARROW " } ) ,
204+ expect . objectContaining ( { format : "ARROW_STREAM " } ) ,
205205 ) ;
206206 } ) ;
207207
208- test ( "auto-selects ARROW_STREAM by default when no heuristics match" , ( ) => {
208+ test ( "auto-selects JSON_ARRAY by default when no heuristics match" , ( ) => {
209209 mockUseAnalyticsQuery . mockReturnValue ( {
210210 data : [ ] ,
211211 loading : false ,
@@ -223,11 +223,11 @@ describe("useChartData", () => {
223223 expect ( mockUseAnalyticsQuery ) . toHaveBeenCalledWith (
224224 "test" ,
225225 { limit : 100 } ,
226- expect . objectContaining ( { format : "ARROW_STREAM " } ) ,
226+ expect . objectContaining ( { format : "JSON_ARRAY " } ) ,
227227 ) ;
228228 } ) ;
229229
230- test ( "defaults to auto format (ARROW_STREAM ) when format is not specified" , ( ) => {
230+ test ( "defaults to auto format (JSON_ARRAY ) when format is not specified" , ( ) => {
231231 mockUseAnalyticsQuery . mockReturnValue ( {
232232 data : [ ] ,
233233 loading : false ,
@@ -243,7 +243,7 @@ describe("useChartData", () => {
243243 expect ( mockUseAnalyticsQuery ) . toHaveBeenCalledWith (
244244 "test" ,
245245 undefined ,
246- expect . objectContaining ( { format : "ARROW_STREAM " } ) ,
246+ expect . objectContaining ( { format : "JSON_ARRAY " } ) ,
247247 ) ;
248248 } ) ;
249249 } ) ;
@@ -353,29 +353,29 @@ describe("useChartData", () => {
353353 expect ( result . current . isArrow ) . toBe ( false ) ;
354354 } ) ;
355355
356- test ( "isArrow reflects requested ARROW format when data is null" , ( ) => {
356+ test ( "isArrow reflects requested ARROW_STREAM format when data is null" , ( ) => {
357357 mockUseAnalyticsQuery . mockReturnValue ( {
358358 data : null ,
359359 loading : true ,
360360 error : null ,
361361 } ) ;
362362
363363 const { result } = renderHook ( ( ) =>
364- useChartData ( { queryKey : "test" , format : "arrow " } ) ,
364+ useChartData ( { queryKey : "test" , format : "arrow_stream " } ) ,
365365 ) ;
366366
367367 expect ( result . current . isArrow ) . toBe ( true ) ;
368368 } ) ;
369369
370- test ( "isArrow reflects requested JSON format when data is null" , ( ) => {
370+ test ( "isArrow reflects requested JSON_ARRAY format when data is null" , ( ) => {
371371 mockUseAnalyticsQuery . mockReturnValue ( {
372372 data : null ,
373373 loading : true ,
374374 error : null ,
375375 } ) ;
376376
377377 const { result } = renderHook ( ( ) =>
378- useChartData ( { queryKey : "test" , format : "json " } ) ,
378+ useChartData ( { queryKey : "test" , format : "json_array " } ) ,
379379 ) ;
380380
381381 expect ( result . current . isArrow ) . toBe ( false ) ;
0 commit comments