@@ -448,7 +448,7 @@ describe('Slack channels', () => {
448448 filters : { startDate : '2026-10-30T00:00:00Z' } ,
449449 native : { provider : 'slack' , query : '' , modifiers : 'in:#announcements' } ,
450450 } )
451- expect ( result . message ) . toContain ( 'No channel named #announcements is visible to this account .' )
451+ expect ( result . message ) . toContain ( 'No channel named #announcements can be searched here .' )
452452 expect ( result . message ) . toContain (
453453 'Channels with similar names: #company-announcements (in:<#C7>).'
454454 )
@@ -485,6 +485,38 @@ describe('Slack channels', () => {
485485 expect ( result . message ) . not . toContain ( '#announcements' )
486486 } )
487487
488+ it ( 'looks up no channel when the query is already scoped to a channel ID' , async ( ) => {
489+ const api = client ( )
490+ api . json . mockResolvedValue ( rts ( [ ] ) )
491+ const result = await searchSlack ( api , {
492+ ...input ,
493+ scopes,
494+ native : { provider : 'slack' , query : 'launch in:<#C1>' , modifiers : 'in:#announcements' } ,
495+ } )
496+ expect ( api . json ) . toHaveBeenCalledTimes ( 1 )
497+ expect ( result . message ) . not . toContain ( '#announcements' )
498+ } )
499+
500+ it . each ( [
501+ [ 'in:#launch-team.' , 'launch-team' ] ,
502+ [ 'in:#équipe_ventes,' , 'équipe_ventes' ] ,
503+ [ 'in:#हिंदी-टीम' , 'हिंदी-टीम' ] ,
504+ ] ) ( 'looks up the whole channel name in %s' , async ( modifiers , name ) => {
505+ const api = client ( )
506+ api . json . mockResolvedValue ( rts ( [ ] ) )
507+ await searchSlack ( api , {
508+ ...input ,
509+ query : '' ,
510+ scopes,
511+ filters : { startDate : '2026-10-30T00:00:00Z' } ,
512+ native : { provider : 'slack' , query : '' , modifiers } ,
513+ } )
514+ expect ( api . json . mock . calls [ 1 ] ?. [ 1 ] ?. body ) . toMatchObject ( {
515+ query : name ,
516+ content_types : [ 'channels' ] ,
517+ } )
518+ } )
519+
488520 it ( 'keeps the empty search when the channel lookup fails' , async ( ) => {
489521 const api = client ( )
490522 api . json
0 commit comments