@@ -424,6 +424,27 @@ const registryWithDemoLoaderNoOutbound = createTestRegistry([
424424 { pluginId : "demo-loader" , plugin : demoNoOutboundPlugin , source : "test-no-outbound" } ,
425425] ) ;
426426
427+ const demoRichRepliesPlugin = createChannelTestPluginBase ( {
428+ id : "demo-loader" ,
429+ label : "Demo Loader" ,
430+ capabilities : {
431+ chatTypes : [ "direct" , "thread" ] ,
432+ richReplies : {
433+ buttons : true ,
434+ selects : false ,
435+ commandFallback : true ,
436+ } ,
437+ interactionResponses : {
438+ acknowledge : true ,
439+ editText : true ,
440+ } ,
441+ } ,
442+ } ) ;
443+
444+ const registryWithRichRepliesPlugin = createTestRegistry ( [
445+ { pluginId : "demo-loader" , plugin : demoRichRepliesPlugin , source : "test-rich-replies" } ,
446+ ] ) ;
447+
427448const demoOriginChannelId = "demo-origin" ;
428449const demoTargetChannelId = "demo-target" ;
429450
@@ -527,6 +548,12 @@ describe("channel plugin loader", () => {
527548 kind : "missing-outbound" as const ,
528549 registry : registryWithDemoLoaderNoOutbound ,
529550 } ,
551+ {
552+ name : "preserves rich reply and interaction capability metadata on loaded plugins" ,
553+ kind : "rich-capabilities" as const ,
554+ registry : registryWithRichRepliesPlugin ,
555+ expectedPlugin : demoRichRepliesPlugin ,
556+ } ,
530557 ] as const ) ( "$name" , async ( testCase ) => {
531558 switch ( testCase . kind ) {
532559 case "plugin" :
@@ -562,6 +589,23 @@ describe("channel plugin loader", () => {
562589 case "missing-outbound" :
563590 await expectOutboundAdapterMissingCase ( testCase . registry ) ;
564591 return ;
592+ case "rich-capabilities" : {
593+ setActivePluginRegistry ( testCase . registry ) ;
594+ await expect ( loadChannelPlugin ( "demo-loader" ) ) . resolves . toMatchObject ( {
595+ capabilities : {
596+ richReplies : {
597+ buttons : true ,
598+ selects : false ,
599+ commandFallback : true ,
600+ } ,
601+ interactionResponses : {
602+ acknowledge : true ,
603+ editText : true ,
604+ } ,
605+ } ,
606+ } ) ;
607+ return ;
608+ }
565609 }
566610 } ) ;
567611} ) ;
0 commit comments