@@ -407,7 +407,7 @@ describe('[api] apify push', () => {
407407 ) ;
408408
409409 it (
410- 'should not enable standby mode on existing actor when usesStandbyMode is true in actor.json' ,
410+ 'should sync standby mode on existing actor based on usesStandbyMode in actor.json' ,
411411 async ( ) => {
412412 // Create an actor without standby mode first
413413 const testActorWithTitleDesc = {
@@ -422,23 +422,34 @@ describe('[api] apify push', () => {
422422 const initialActor = await testActorClient . get ( ) ;
423423 expect ( initialActor ?. actorStandby ?. isEnabled ) . to . not . be . eql ( true ) ;
424424
425- // Enable standby
426425 const actorJson = JSON . parse ( readFileSync ( joinPath ( LOCAL_CONFIG_PATH ) , 'utf8' ) ) ;
426+
427+ // Enable standby in actor.json and push
427428 actorJson . usesStandbyMode = true ;
428429 writeFileSync ( joinPath ( LOCAL_CONFIG_PATH ) , JSON . stringify ( actorJson , null , '\t' ) , { flag : 'w' } ) ;
430+ await testRunCommand ( ActorsPushCommand , {
431+ args_actorId : testActor . id ,
432+ flags_noPrompt : true ,
433+ flags_force : true ,
434+ } ) ;
429435
430- // Push to existing actor - this should update standby mode
436+ const enabledActor = await testActorClient . get ( ) ;
437+ expect ( enabledActor ?. actorStandby ?. isEnabled ) . to . be . eql ( true ) ;
438+
439+ // Remove usesStandbyMode from actor.json and push again (should disable)
440+ delete actorJson . usesStandbyMode ;
441+ writeFileSync ( joinPath ( LOCAL_CONFIG_PATH ) , JSON . stringify ( actorJson , null , '\t' ) , { flag : 'w' } ) ;
442+ resetCwdCaches ( ) ;
431443 await testRunCommand ( ActorsPushCommand , {
432444 args_actorId : testActor . id ,
433445 flags_noPrompt : true ,
434446 flags_force : true ,
435447 } ) ;
436448
437- const updatedActor = await testActorClient . get ( ) ;
449+ const disabledActor = await testActorClient . get ( ) ;
450+ expect ( disabledActor ?. actorStandby ?. isEnabled ) . to . be . eql ( false ) ;
438451
439- // Verify standby is not enabled after push
440- expect ( updatedActor ?. actorStandby ?. isEnabled ) . to . not . be . eql ( true ) ;
441- if ( updatedActor ) await testActorClient . delete ( ) ;
452+ if ( disabledActor ) await testActorClient . delete ( ) ;
442453 } ,
443454 TEST_TIMEOUT ,
444455 ) ;
0 commit comments