@@ -21,6 +21,10 @@ const baseSettings = {
2121 usage_request_timeout_seconds : 15 ,
2222 proxy_host : "127.0.0.1" ,
2323 proxy_port : 6789 ,
24+ upstream_proxy_mode : "system" ,
25+ upstream_proxy_url : "" ,
26+ upstream_proxy_username : "" ,
27+ upstream_proxy_password : "" ,
2428 auto_failover_enabled : true ,
2529 auto_backup_interval_hours : 24 ,
2630 backup_retention_count : 10 ,
@@ -107,6 +111,8 @@ describe("SettingsPage", () => {
107111 expect ( screen . getByRole ( "tab" , { name : "关于" } ) ) . toBeInTheDocument ( ) ;
108112 fireEvent . click ( screen . getByRole ( "tab" , { name : "代理" } ) ) ;
109113 expect ( await screen . findByRole ( "switch" , { name : "自动故障转移开关" } ) ) . toBeInTheDocument ( ) ;
114+ fireEvent . click ( screen . getByRole ( "radio" , { name : "手动指定" } ) ) ;
115+ fireEvent . change ( screen . getByRole ( "textbox" , { name : "上游代理地址" } ) , { target : { value : "http://127.0.0.1:7890" } } ) ;
110116 expect ( screen . queryByText ( "自动故障转移队列" ) ) . not . toBeInTheDocument ( ) ;
111117 fireEvent . click ( screen . getByRole ( "tab" , { name : "数据" } ) ) ;
112118 expect ( await screen . findByText ( "费用统计" ) ) . toBeInTheDocument ( ) ;
@@ -125,6 +131,8 @@ describe("SettingsPage", () => {
125131 body : JSON . stringify ( {
126132 ...baseSettings ,
127133 launch_at_login : true ,
134+ upstream_proxy_mode : "manual" ,
135+ upstream_proxy_url : "http://127.0.0.1:7890" ,
128136 provider_pricing : { codex : { input_per_million : 4.5 , output_per_million : 0 } } ,
129137 account_pricing : { "1" : { input_per_million : 0 , output_per_million : 15.2 } } ,
130138 } ) ,
@@ -134,12 +142,16 @@ describe("SettingsPage", () => {
134142 expect ( applyDesktopAppSettings ) . toHaveBeenCalledWith ( {
135143 ...baseSettings ,
136144 launch_at_login : true ,
145+ upstream_proxy_mode : "manual" ,
146+ upstream_proxy_url : "http://127.0.0.1:7890" ,
137147 provider_pricing : { codex : { input_per_million : 4.5 , output_per_million : 0 } } ,
138148 account_pricing : { "1" : { input_per_million : 0 , output_per_million : 15.2 } } ,
139149 } ) ;
140150 expect ( onSettingsChanged ) . toHaveBeenCalledWith ( {
141151 ...baseSettings ,
142152 launch_at_login : true ,
153+ upstream_proxy_mode : "manual" ,
154+ upstream_proxy_url : "http://127.0.0.1:7890" ,
143155 provider_pricing : { codex : { input_per_million : 4.5 , output_per_million : 0 } } ,
144156 account_pricing : { "1" : { input_per_million : 0 , output_per_million : 15.2 } } ,
145157 } ) ;
0 commit comments