@@ -99,16 +99,14 @@ describe("state migrations", () => {
9999 expect ( detected . whatsappAuth . hasLegacy ) . toBe ( true ) ;
100100 expect ( detected . pairingAllowFrom . hasLegacyTelegram ) . toBe ( true ) ;
101101 expect ( detected . pairingAllowFrom . copyPlans . map ( ( plan ) => plan . targetPath ) ) . toEqual ( [
102- resolveChannelAllowFromPath ( "telegram" , env , "alpha" ) ,
103- resolveChannelAllowFromPath ( "telegram" , env , "beta" ) ,
102+ resolveChannelAllowFromPath ( "telegram" , env , "default" ) ,
104103 ] ) ;
105104 expect ( detected . preview ) . toEqual ( [
106105 `- Sessions: ${ path . join ( stateDir , "sessions" ) } → ${ path . join ( stateDir , "agents" , "worker-1" , "sessions" ) } ` ,
107106 `- Sessions: canonicalize legacy keys in ${ path . join ( stateDir , "agents" , "worker-1" , "sessions" , "sessions.json" ) } ` ,
108107 `- Agent dir: ${ path . join ( stateDir , "agent" ) } → ${ path . join ( stateDir , "agents" , "worker-1" , "agent" ) } ` ,
109108 `- WhatsApp auth: ${ path . join ( stateDir , "credentials" ) } → ${ path . join ( stateDir , "credentials" , "whatsapp" , "default" ) } (keep oauth.json)` ,
110- `- Telegram pairing allowFrom: ${ resolveChannelAllowFromPath ( "telegram" , env ) } → ${ resolveChannelAllowFromPath ( "telegram" , env , "alpha" ) } ` ,
111- `- Telegram pairing allowFrom: ${ resolveChannelAllowFromPath ( "telegram" , env ) } → ${ resolveChannelAllowFromPath ( "telegram" , env , "beta" ) } ` ,
109+ `- Telegram pairing allowFrom: ${ resolveChannelAllowFromPath ( "telegram" , env ) } → ${ resolveChannelAllowFromPath ( "telegram" , env , "default" ) } ` ,
112110 ] ) ;
113111 } ) ;
114112
@@ -134,8 +132,7 @@ describe("state migrations", () => {
134132 "Moved agent file settings.json → agents/worker-1/agent" ,
135133 "Moved WhatsApp auth creds.json → whatsapp/default" ,
136134 "Moved WhatsApp auth pre-key-1.json → whatsapp/default" ,
137- `Copied Telegram pairing allowFrom → ${ resolveChannelAllowFromPath ( "telegram" , env , "alpha" ) } ` ,
138- `Copied Telegram pairing allowFrom → ${ resolveChannelAllowFromPath ( "telegram" , env , "beta" ) } ` ,
135+ `Copied Telegram pairing allowFrom → ${ resolveChannelAllowFromPath ( "telegram" , env , "default" ) } ` ,
139136 ] ) ;
140137
141138 const mergedStore = JSON . parse (
@@ -173,10 +170,13 @@ describe("state migrations", () => {
173170 fs . readFile ( path . join ( stateDir , "credentials" , "oauth.json" ) , "utf8" ) ,
174171 ) . resolves . toContain ( '"oauth":true' ) ;
175172 await expect (
176- fs . readFile ( resolveChannelAllowFromPath ( "telegram" , env , "alpha " ) , "utf8" ) ,
173+ fs . readFile ( resolveChannelAllowFromPath ( "telegram" , env , "default " ) , "utf8" ) ,
177174 ) . resolves . toBe ( '["123","456"]\n' ) ;
178175 await expect (
179- fs . readFile ( resolveChannelAllowFromPath ( "telegram" , env , "beta" ) , "utf8" ) ,
180- ) . resolves . toBe ( '["123","456"]\n' ) ;
176+ fs . stat ( resolveChannelAllowFromPath ( "telegram" , env , "alpha" ) ) ,
177+ ) . rejects . toMatchObject ( { code : "ENOENT" } ) ;
178+ await expect (
179+ fs . stat ( resolveChannelAllowFromPath ( "telegram" , env , "beta" ) ) ,
180+ ) . rejects . toMatchObject ( { code : "ENOENT" } ) ;
181181 } ) ;
182182} ) ;
0 commit comments