@@ -508,39 +508,31 @@ describe("Android delivery routing", () => {
508508 } ) . pipe ( Effect . provide ( h . layer ) ) ;
509509 } ) ;
510510
511- it . effect ( "honors disabled alert preferences while continuing ongoing activity" , ( ) => {
512- const h = harness ( ) ;
513- h . current . state = { ...state , phase : "waiting_for_approval" } ;
514- h . current . target . preferences_json = encodeJson ( { ...preferences , notifyOnApproval : false } ) ;
515- return Effect . gen ( function * ( ) {
516- const delivery = yield * FcmDeliveries . FcmDeliveries ;
517- yield * delivery . process ( { ...h . job , state : h . current . state } ) ;
518- expect ( h . sent [ 0 ] ?. data . active ) . toBe ( "true" ) ;
519- expect ( h . sent [ 0 ] ?. data . alert_id ) . toBeUndefined ( ) ;
511+ it . effect (
512+ "continues ongoing activity when alerts are disabled, with or without a previous card" ,
513+ ( ) => {
514+ const h = harness ( ) ;
515+ h . current . state = { ...state , phase : "waiting_for_approval" } ;
520516 h . current . target . preferences_json = encodeJson ( {
521517 ...preferences ,
522518 notificationsEnabled : false ,
523519 } ) ;
524- h . current . target . last_aggregate_json = encodeJson ( aggregateFor ( [ state ] ) ) ;
525- yield * delivery . process ( { ...h . job , state : h . current . state } ) ;
526- expect ( h . sent [ 1 ] ?. data . active ) . toBe ( "true" ) ;
527- expect ( h . sent [ 1 ] ?. data . alert_id ) . toBeUndefined ( ) ;
528- expect ( h . marked . at ( - 1 ) ?. kind ) . toBe ( "live_activity_update" ) ;
529- } ) . pipe ( Effect . provide ( h . layer ) ) ;
530- } ) ;
531-
532- it . effect ( "starts ongoing activity without ordinary notifications or a previous card" , ( ) => {
533- const h = harness ( ) ;
534- h . current . target . preferences_json = encodeJson ( { ...preferences , notificationsEnabled : false } ) ;
535- return Effect . gen ( function * ( ) {
536- const delivery = yield * FcmDeliveries . FcmDeliveries ;
537- yield * delivery . process ( h . job ) ;
538- expect ( h . sent ) . toHaveLength ( 1 ) ;
539- expect ( h . sent [ 0 ] ?. data . active ) . toBe ( "true" ) ;
540- expect ( h . sent [ 0 ] ?. alert ) . toBe ( false ) ;
541- expect ( h . sent [ 0 ] ?. data . alert_id ) . toBeUndefined ( ) ;
542- } ) . pipe ( Effect . provide ( h . layer ) ) ;
543- } ) ;
520+ return Effect . gen ( function * ( ) {
521+ const delivery = yield * FcmDeliveries . FcmDeliveries ;
522+ yield * delivery . process ( { ...h . job , state : h . current . state } ) ;
523+ expect ( h . sent ) . toHaveLength ( 1 ) ;
524+ expect ( h . sent [ 0 ] ?. data . active ) . toBe ( "true" ) ;
525+ expect ( h . sent [ 0 ] ?. alert ) . toBe ( false ) ;
526+ expect ( h . sent [ 0 ] ?. data . alert_id ) . toBeUndefined ( ) ;
527+ h . current . target . preferences_json = encodeJson ( { ...preferences , notifyOnApproval : false } ) ;
528+ h . current . target . last_aggregate_json = encodeJson ( aggregateFor ( [ state ] ) ) ;
529+ yield * delivery . process ( { ...h . job , state : h . current . state } ) ;
530+ expect ( h . sent [ 1 ] ?. data . active ) . toBe ( "true" ) ;
531+ expect ( h . sent [ 1 ] ?. data . alert_id ) . toBeUndefined ( ) ;
532+ expect ( h . marked . at ( - 1 ) ?. kind ) . toBe ( "live_activity_update" ) ;
533+ } ) . pipe ( Effect . provide ( h . layer ) ) ;
534+ } ,
535+ ) ;
544536
545537 it . effect ( "replays an empty card to repair an orphan without a delivery baseline" , ( ) => {
546538 const h = harness ( ) ;
0 commit comments