@@ -19,6 +19,7 @@ function createConfig(): OpenClawConfig {
1919 } ,
2020 channels : {
2121 telegram : {
22+ defaultAccount : "alpha" ,
2223 accounts : {
2324 beta : { } ,
2425 alpha : { } ,
@@ -100,15 +101,13 @@ describe("state migrations", () => {
100101 expect ( detected . pairingAllowFrom . hasLegacyTelegram ) . toBe ( true ) ;
101102 expect ( detected . pairingAllowFrom . copyPlans . map ( ( plan ) => plan . targetPath ) ) . toEqual ( [
102103 resolveChannelAllowFromPath ( "telegram" , env , "alpha" ) ,
103- resolveChannelAllowFromPath ( "telegram" , env , "beta" ) ,
104104 ] ) ;
105105 expect ( detected . preview ) . toEqual ( [
106106 `- Sessions: ${ path . join ( stateDir , "sessions" ) } → ${ path . join ( stateDir , "agents" , "worker-1" , "sessions" ) } ` ,
107107 `- Sessions: canonicalize legacy keys in ${ path . join ( stateDir , "agents" , "worker-1" , "sessions" , "sessions.json" ) } ` ,
108108 `- Agent dir: ${ path . join ( stateDir , "agent" ) } → ${ path . join ( stateDir , "agents" , "worker-1" , "agent" ) } ` ,
109109 `- WhatsApp auth: ${ path . join ( stateDir , "credentials" ) } → ${ path . join ( stateDir , "credentials" , "whatsapp" , "default" ) } (keep oauth.json)` ,
110110 `- Telegram pairing allowFrom: ${ resolveChannelAllowFromPath ( "telegram" , env ) } → ${ resolveChannelAllowFromPath ( "telegram" , env , "alpha" ) } ` ,
111- `- Telegram pairing allowFrom: ${ resolveChannelAllowFromPath ( "telegram" , env ) } → ${ resolveChannelAllowFromPath ( "telegram" , env , "beta" ) } ` ,
112111 ] ) ;
113112 } ) ;
114113
@@ -135,7 +134,6 @@ describe("state migrations", () => {
135134 "Moved WhatsApp auth creds.json → whatsapp/default" ,
136135 "Moved WhatsApp auth pre-key-1.json → whatsapp/default" ,
137136 `Copied Telegram pairing allowFrom → ${ resolveChannelAllowFromPath ( "telegram" , env , "alpha" ) } ` ,
138- `Copied Telegram pairing allowFrom → ${ resolveChannelAllowFromPath ( "telegram" , env , "beta" ) } ` ,
139137 ] ) ;
140138
141139 const mergedStore = JSON . parse (
@@ -176,7 +174,10 @@ describe("state migrations", () => {
176174 fs . readFile ( resolveChannelAllowFromPath ( "telegram" , env , "alpha" ) , "utf8" ) ,
177175 ) . resolves . toBe ( '["123","456"]\n' ) ;
178176 await expect (
179- fs . readFile ( resolveChannelAllowFromPath ( "telegram" , env , "beta" ) , "utf8" ) ,
180- ) . resolves . toBe ( '["123","456"]\n' ) ;
177+ fs . stat ( resolveChannelAllowFromPath ( "telegram" , env , "default" ) ) ,
178+ ) . rejects . toMatchObject ( { code : "ENOENT" } ) ;
179+ await expect (
180+ fs . stat ( resolveChannelAllowFromPath ( "telegram" , env , "beta" ) ) ,
181+ ) . rejects . toMatchObject ( { code : "ENOENT" } ) ;
181182 } ) ;
182183} ) ;
0 commit comments