@@ -251,22 +251,6 @@ describe('Metadata', () => {
251251 ] ,
252252 } ) ,
253253 } ) ;
254-
255- // Mock getColumns to return columns including materialized ones
256- mockCache . getOrFetch . mockImplementation ( ( key , queryFn ) => {
257- if ( key . includes ( '.columns' ) ) {
258- return Promise . resolve ( [
259- { name : 'regular_column' , type : 'String' , default_type : '' } ,
260- {
261- name : 'materialized_column' ,
262- type : 'String' ,
263- default_type : 'MATERIALIZED' ,
264- } ,
265- { name : 'default_column' , type : 'String' , default_type : 'DEFAULT' } ,
266- ] ) ;
267- }
268- return queryFn ( ) ;
269- } ) ;
270254 } ) ;
271255
272256 it ( 'should apply row limit when disableRowLimit is false' , async ( ) => {
@@ -355,54 +339,15 @@ describe('Metadata', () => {
355339 expect ( result ) . toEqual ( [ { key : 'column1' , value : [ 'value1' , 'value2' ] } ] ) ;
356340 } ) ;
357341
358- it ( 'should include materialized fields when selecting all columns ' , async ( ) => {
342+ it ( 'should fallback to * when no keys are provided ' , async ( ) => {
359343 const renderChartConfigSpy = jest . spyOn (
360344 renderChartConfigModule ,
361345 'renderChartConfig' ,
362346 ) ;
363347
364348 await metadata . getKeyValues ( {
365349 chartConfig : mockChartConfig ,
366- keys : [ 'column1' ] ,
367- limit : 10 ,
368- } ) ;
369-
370- // Verify that renderChartConfig was called with the expanded select list
371- // that includes all columns by name (including materialized ones)
372- expect ( renderChartConfigSpy ) . toHaveBeenCalledWith (
373- expect . objectContaining ( {
374- with : [
375- expect . objectContaining ( {
376- name : 'sampledData' ,
377- chartConfig : expect . objectContaining ( {
378- // Should expand to all column names instead of using '*'
379- select :
380- '`regular_column`, `materialized_column`, `default_column`' ,
381- } ) ,
382- } ) ,
383- ] ,
384- } ) ,
385- metadata ,
386- ) ;
387- } ) ;
388-
389- it ( 'should fallback to * when no columns are found' , async ( ) => {
390- // Mock getColumns to return empty array
391- mockCache . getOrFetch . mockImplementation ( ( key , queryFn ) => {
392- if ( key . includes ( '.columns' ) ) {
393- return Promise . resolve ( [ ] ) ;
394- }
395- return queryFn ( ) ;
396- } ) ;
397-
398- const renderChartConfigSpy = jest . spyOn (
399- renderChartConfigModule ,
400- 'renderChartConfig' ,
401- ) ;
402-
403- await metadata . getKeyValues ( {
404- chartConfig : mockChartConfig ,
405- keys : [ 'column1' ] ,
350+ keys : [ ] ,
406351 limit : 10 ,
407352 } ) ;
408353
0 commit comments