@@ -12,7 +12,7 @@ import {
1212import { QueryExecutionStatus } from '../../../application/utils/state_management/types' ;
1313import { useOpenSearchDashboards } from '../../../../../opensearch_dashboards_react/public' ;
1414import { loadQueryActionCreator } from '../../../application/utils/state_management/actions/query_editor/load_query' ;
15- import { defaultPrepareQueryString } from '../../../application/utils/state_management/actions/query_actions ' ;
15+ import { prepareQueryForLanguage } from '../../../application/utils/languages ' ;
1616import { useDispatch } from 'react-redux' ;
1717
1818// Mock dependencies
@@ -26,8 +26,8 @@ jest.mock('../../../application/utils/state_management/actions/query_editor/load
2626 loadQueryActionCreator : jest . fn ( ) ,
2727} ) ) ;
2828
29- jest . mock ( '../../../application/utils/state_management/actions/query_actions ' , ( ) => ( {
30- defaultPrepareQueryString : jest . fn ( ) ,
29+ jest . mock ( '../../../application/utils/languages ' , ( ) => ( {
30+ prepareQueryForLanguage : jest . fn ( ) ,
3131} ) ) ;
3232
3333jest . mock ( 'react-redux' , ( ) => ( {
@@ -59,14 +59,14 @@ describe('usePPLExecuteQueryAction', () => {
5959 let mockUseOpenSearchDashboards : jest . Mock ;
6060 let mockLoadQueryActionCreator : jest . Mock ;
6161 let mockUseDispatch : jest . Mock ;
62- let mockDefaultPrepareQueryString : jest . Mock ;
62+ let mockPrepareQueryForLanguage : jest . Mock ;
6363 let mockDispatch : jest . Mock ;
6464
6565 beforeEach ( ( ) => {
6666 // Get the mocked functions
6767 mockUseOpenSearchDashboards = useOpenSearchDashboards as jest . Mock ;
6868 mockLoadQueryActionCreator = loadQueryActionCreator as jest . Mock ;
69- mockDefaultPrepareQueryString = defaultPrepareQueryString as jest . Mock ;
69+ mockPrepareQueryForLanguage = prepareQueryForLanguage as jest . Mock ;
7070 mockUseDispatch = useDispatch as jest . Mock ;
7171 mockDispatch = jest . fn ( ) ;
7272
@@ -95,7 +95,7 @@ describe('usePPLExecuteQueryAction', () => {
9595 // Setup mocks
9696 mockUseOpenSearchDashboards . mockReturnValue ( { services : mockServices } ) ;
9797 mockLoadQueryActionCreator . mockReturnValue ( { type : 'LOAD_QUERY' } ) ;
98- mockDefaultPrepareQueryString . mockReturnValue ( 'test-cache-key' ) ;
98+ mockPrepareQueryForLanguage . mockReturnValue ( { query : 'test-cache-key' } ) ;
9999 mockSetEditorTextWithQuery = jest . fn ( ) ;
100100 mockUseDispatch . mockReturnValue ( mockDispatch ) ;
101101 mockUseAssistantAction . mockClear ( ) ;
@@ -448,7 +448,7 @@ describe('usePPLExecuteQueryAction', () => {
448448 await resultPromise ;
449449
450450 // Verify that defaultPrepareQueryString was called with the correct query object
451- expect ( mockDefaultPrepareQueryString ) . toHaveBeenCalledWith ( {
451+ expect ( mockPrepareQueryForLanguage ) . toHaveBeenCalledWith ( {
452452 dataSource : 'test-source' ,
453453 timeRange : { from : 'now-1h' , to : 'now' } ,
454454 query : 'source=logs | where status="error"' ,
0 commit comments