@@ -25,6 +25,7 @@ assert.equal(indexHtml.includes("loginLink.hidden = !state.auth.available || sig
2525assert . ok ( indexHtml . includes ( 'id="min-reserved-cash-input"' ) ) ;
2626assert . ok ( indexHtml . includes ( 'id="reserved-cash-ratio-input"' ) ) ;
2727assert . ok ( indexHtml . includes ( 'id="reserve-policy-mode-select"' ) ) ;
28+ assert . ok ( indexHtml . includes ( 'id="runtime-target-enabled-select"' ) ) ;
2829assert . ok ( indexHtml . includes ( 'id="plugin-mode-select"' ) ) ;
2930assert . ok ( indexHtml . includes ( "account-block" ) ) ;
3031assert . ok ( indexHtml . includes ( "strategy-block" ) ) ;
@@ -38,6 +39,10 @@ assert.ok(indexHtml.includes('reservePolicyFloor'));
3839assert . ok ( indexHtml . includes ( 'reservePolicyMax' ) ) ;
3940assert . ok ( indexHtml . includes ( 'pluginModeAuto' ) ) ;
4041assert . ok ( indexHtml . includes ( 'pluginModeNone' ) ) ;
42+ assert . ok ( indexHtml . includes ( 'runtimeTargetMode: "账号运行状态"' ) ) ;
43+ assert . ok ( indexHtml . includes ( 'runtimeTargetEnabled: "启用正式运行"' ) ) ;
44+ assert . ok ( indexHtml . includes ( 'runtimeTargetDisabled: "停用正式运行"' ) ) ;
45+ assert . ok ( indexHtml . includes ( 'runtimeTargetMode: "Account status"' ) ) ;
4146assert . ok ( indexHtml . includes ( 'pluginMode: "插件启用范围"' ) ) ;
4247assert . ok ( indexHtml . includes ( 'pluginModeAuto: "按策略默认"' ) ) ;
4348assert . ok ( indexHtml . includes ( 'pluginModeNone: "完全禁用"' ) ) ;
@@ -62,6 +67,7 @@ assert.ok(indexHtml.includes('.summary-row.pending'));
6267assert . ok ( indexHtml . includes ( 'function currentEntryHasState(' ) ) ;
6368assert . ok ( indexHtml . includes ( 'changes.reserveCashChanged' ) ) ;
6469assert . ok ( indexHtml . includes ( 'changes.pluginModeChanged' ) ) ;
70+ assert . ok ( indexHtml . includes ( 'changes.runtimeTargetChanged' ) ) ;
6571assert . ok ( indexHtml . includes ( '!hasPendingChange' ) ) ;
6672assert . ok ( indexHtml . includes ( 'hasPendingChange ? t("readyNote") : ""' ) ) ;
6773assert . equal ( indexHtml . includes ( 'hasPendingChange ? t("readyNote") : t("noChangesNote")' ) , false ) ;
@@ -420,6 +426,12 @@ globalThis.fetch = async (url) => {
420426 headers : { "Content-Type" : "application/json" } ,
421427 } ) ;
422428 }
429+ if ( requestUrl . endsWith ( "/RUNTIME_TARGET_ENABLED" ) ) {
430+ return new Response ( JSON . stringify ( { value : "false" } ) , {
431+ status : 200 ,
432+ headers : { "Content-Type" : "application/json" } ,
433+ } ) ;
434+ }
423435 if ( requestUrl . endsWith ( "/RUNTIME_TARGET_JSON" ) ) {
424436 return new Response ( JSON . stringify ( {
425437 value : JSON . stringify ( {
@@ -443,6 +455,7 @@ try {
443455 assert . equal ( currentStrategies . schwab . default . execution_mode , "live" ) ;
444456 assert . equal ( currentStrategies . schwab . default . min_reserved_cash_usd , "150" ) ;
445457 assert . equal ( currentStrategies . schwab . default . reserved_cash_ratio , "0.03" ) ;
458+ assert . equal ( currentStrategies . schwab . default . runtime_target_enabled , false ) ;
446459 assert . equal ( currentStrategies . schwab . default . source , "RUNTIME_TARGET_JSON" ) ;
447460} finally {
448461 globalThis . fetch = originalFetch ;
@@ -459,6 +472,7 @@ globalThis.fetch = async (url) => {
459472 ACCOUNT_GROUP : "demo-ibkr-tqqq" ,
460473 IBKR_MIN_RESERVED_CASH_USD : "150" ,
461474 IBKR_RESERVED_CASH_RATIO : "0.03" ,
475+ RUNTIME_TARGET_ENABLED : "false" ,
462476 runtime_target : {
463477 platform_id : "ibkr" ,
464478 strategy_profile : "tqqq_growth_income" ,
@@ -482,6 +496,7 @@ try {
482496 assert . equal ( currentStrategies . ibkr [ "ibkr-primary" ] . strategy_profile , "tqqq_growth_income" ) ;
483497 assert . equal ( currentStrategies . ibkr [ "ibkr-primary" ] . min_reserved_cash_usd , "150" ) ;
484498 assert . equal ( currentStrategies . ibkr [ "ibkr-primary" ] . reserved_cash_ratio , "0.03" ) ;
499+ assert . equal ( currentStrategies . ibkr [ "ibkr-primary" ] . runtime_target_enabled , false ) ;
485500 assert . equal ( currentStrategies . ibkr [ "ibkr-primary" ] . source , "CLOUD_RUN_SERVICE_TARGETS_JSON" ) ;
486501} finally {
487502 globalThis . fetch = originalFetch ;
0 commit comments