@@ -432,20 +432,21 @@ describe('guard: IU wiring boundaries', () => {
432432 } )
433433} )
434434
435- describe ( 'guard: IU notification setting gating' , ( ) => {
436- it ( 'resolves the id by action category and attaches it to both the buffered email and the in-product dispatch ' , async ( ) => {
435+ describe ( 'guard: IU notifications ship ungated (settingId gating disabled) ' , ( ) => {
436+ it ( 'does not attach notificationSettingId to the in-product dispatch or the buffered email ' , async ( ) => {
437437 const task = makeTask ( { assigneeType : AssigneeType . internalUser , clientId : null } )
438438 await buildService ( ) . create ( NotificationTaskActions . Assigned , task , { disableEmail : false } )
439439
440- expect ( mockGroupedCreateMany . mock . calls [ 0 ] [ 0 ] . data [ 0 ] . individualEmail . notificationSettingId ) . toBe ( 'setting_assigned' )
441- expect ( mockCreateNotification . mock . calls [ 0 ] [ 0 ] . notificationSettingId ) . toBe ( 'setting_assigned' )
440+ expect ( mockCreateNotification . mock . calls [ 0 ] [ 0 ] . notificationSettingId ) . toBeUndefined ( )
441+ expect ( mockGroupedCreateMany . mock . calls [ 0 ] [ 0 ] . data [ 0 ] . individualEmail . notificationSettingId ) . toBeUndefined ( )
442442 } )
443443
444- it ( 'resolves a different id per category (COMPLETED vs ASSIGNED) ' , async ( ) => {
444+ it ( 'still buffers the IU email and fires the in-product notification ' , async ( ) => {
445445 const task = makeTask ( { assigneeType : AssigneeType . internalUser , clientId : null } )
446- await buildService ( ) . create ( NotificationTaskActions . CompletedByIU , task , { disableEmail : false } )
446+ await buildService ( ) . create ( NotificationTaskActions . Assigned , task , { disableEmail : false } )
447447
448- expect ( mockCreateNotification . mock . calls [ 0 ] [ 0 ] . notificationSettingId ) . toBe ( 'setting_completed' )
448+ expect ( mockGroupedCreateMany ) . toHaveBeenCalledTimes ( 1 )
449+ expect ( deliveryTargetsOf ( 0 ) . inProduct ) . toBeDefined ( )
449450 } )
450451
451452 it ( 'keeps IU grouped windows cross-category (window key is not scoped by event type)' , async ( ) => {
@@ -455,17 +456,6 @@ describe('guard: IU notification setting gating', () => {
455456 expect ( mockGroupedCreateMany . mock . calls [ 0 ] [ 0 ] . data [ 0 ] . windowKey ) . toMatch ( new RegExp ( `^${ task . assigneeId } :iu:[^:]+$` ) )
456457 } )
457458
458- it ( 'still buffers the IU email but attaches no id when the category is not declared (gating deferred to flush)' , async ( ) => {
459- mockGetNotificationSettings . mockResolvedValue ( { notifications : [ ] } )
460- const task = makeTask ( { assigneeType : AssigneeType . internalUser , clientId : null } )
461- await buildService ( ) . create ( NotificationTaskActions . Assigned , task , { disableEmail : false } )
462-
463- expect ( mockGroupedCreateMany ) . toHaveBeenCalledTimes ( 1 )
464- expect ( mockGroupedCreateMany . mock . calls [ 0 ] [ 0 ] . data [ 0 ] . individualEmail . notificationSettingId ) . toBeUndefined ( )
465- expect ( mockCreateNotification . mock . calls [ 0 ] [ 0 ] . notificationSettingId ) . toBeUndefined ( )
466- expect ( deliveryTargetsOf ( 0 ) . inProduct ) . toBeDefined ( )
467- } )
468-
469459 it ( 'treats a suppressed (null) createNotification response as a no-op — no throw, no save' , async ( ) => {
470460 // Platform dropped the only requested surface for this IU (preference off) → no created object.
471461 mockCreateNotification . mockResolvedValue ( null )
0 commit comments