@@ -221,6 +221,41 @@ assert.deepEqual(accountOptions.longbridge[1].supported_domains, ["us_equity", "
221221assert . deepEqual ( accountOptions . ibkr [ 0 ] . supported_domains , [ "us_equity" , "hk_equity" ] ) ;
222222assert . equal ( accountOptions . longbridge [ 0 ] . cash_currency , "HKD" ) ;
223223
224+ const kvUnboundSyncResponse = await worker . fetch (
225+ new Request ( "https://switch.example/api/internal/sync-account-default" , {
226+ method : "POST" ,
227+ headers : {
228+ Authorization : "Bearer test-sync-token" ,
229+ "Content-Type" : "application/json" ,
230+ } ,
231+ body : JSON . stringify ( {
232+ platform : "ibkr" ,
233+ target_name : "ibkr-primary" ,
234+ account_selector : "DEMO_IBKR_PRIMARY" ,
235+ deployment_selector : "demo-ibkr-tqqq" ,
236+ account_scope : "demo-ibkr-tqqq" ,
237+ service_name : "interactive-brokers-demo-ibkr-tqqq-service" ,
238+ strategy_profile : "tqqq_growth_income" ,
239+ execution_mode : "live" ,
240+ variable_scope : "default" ,
241+ plugin_mode : "auto" ,
242+ } ) ,
243+ } ) ,
244+ {
245+ STRATEGY_SWITCH_SYNC_TOKEN : "test-sync-token" ,
246+ STRATEGY_SWITCH_ACCOUNT_OPTIONS_JSON : JSON . stringify ( accountOptions ) ,
247+ STRATEGY_SWITCH_STRATEGY_PROFILES_JSON : JSON . stringify ( strategyProfiles ) ,
248+ } ,
249+ ) ;
250+ assert . equal ( kvUnboundSyncResponse . status , 200 ) ;
251+ const kvUnboundSyncBody = await kvUnboundSyncResponse . json ( ) ;
252+ assert . equal ( kvUnboundSyncBody . ok , true ) ;
253+ assert . deepEqual ( kvUnboundSyncBody . account_options_sync , {
254+ synced : false ,
255+ reason : "kv_not_bound" ,
256+ skipped : true ,
257+ } ) ;
258+
224259const normalizedReservedCashInputs = __test . normalizeSwitchInputs ( {
225260 platform : "ibkr" ,
226261 target_name : "ibkr-primary" ,
0 commit comments