11import { setupTransactionSearch } from '../post-deploy-observability.js' ;
22import { beforeEach , describe , expect , it , vi } from 'vitest' ;
33
4- const { mockEnableTransactionSearch, mockReadCliConfig } = vi . hoisted ( ( ) => ( {
4+ const { mockEnableTransactionSearch, mockReadGlobalConfigSync } = vi . hoisted ( ( ) => ( {
55 mockEnableTransactionSearch : vi . fn ( ) ,
6- mockReadCliConfig : vi . fn ( ) ,
6+ mockReadGlobalConfigSync : vi . fn ( ) ,
77} ) ) ;
88
99vi . mock ( '../../../aws/transaction-search' , ( ) => ( {
1010 enableTransactionSearch : mockEnableTransactionSearch ,
1111} ) ) ;
1212
13- vi . mock ( '../../../../lib/schemas/io/cli -config' , ( ) => ( {
14- readCliConfig : mockReadCliConfig ,
13+ vi . mock ( '../../../../lib/schemas/io/global -config' , ( ) => ( {
14+ readGlobalConfigSync : mockReadGlobalConfigSync ,
1515} ) ) ;
1616
1717describe ( 'setupTransactionSearch' , ( ) => {
1818 beforeEach ( ( ) => {
1919 vi . clearAllMocks ( ) ;
20- mockReadCliConfig . mockReturnValue ( { } ) ;
20+ mockReadGlobalConfigSync . mockReturnValue ( { } ) ;
2121 mockEnableTransactionSearch . mockResolvedValue ( { success : true } ) ;
2222 } ) ;
2323
@@ -33,7 +33,7 @@ describe('setupTransactionSearch', () => {
3333 } ) ;
3434
3535 it ( 'passes custom transactionSearchIndexPercentage from config' , async ( ) => {
36- mockReadCliConfig . mockReturnValue ( { transactionSearchIndexPercentage : 25 } ) ;
36+ mockReadGlobalConfigSync . mockReturnValue ( { transactionSearchIndexPercentage : 25 } ) ;
3737
3838 const result = await setupTransactionSearch ( {
3939 region : 'us-east-1' ,
@@ -57,7 +57,7 @@ describe('setupTransactionSearch', () => {
5757 } ) ;
5858
5959 it ( 'skips when disableTransactionSearch is true in config' , async ( ) => {
60- mockReadCliConfig . mockReturnValue ( { disableTransactionSearch : true } ) ;
60+ mockReadGlobalConfigSync . mockReturnValue ( { disableTransactionSearch : true } ) ;
6161
6262 const result = await setupTransactionSearch ( {
6363 region : 'us-east-1' ,
0 commit comments