@@ -296,6 +296,51 @@ describe('resolveConversationType', () => {
296296 const result = resolveConversationType ( { platforms : [ 'web' ] } , type )
297297 expect ( result . adapters ) . toHaveLength ( 0 )
298298 } )
299+
300+ test ( 'matches composite platform key over individual keys' , ( ) => {
301+ const type : ConversationType = {
302+ ...baseType ,
303+ properties : [ ] ,
304+ adapters : {
305+ zoom : { type : 'zoom' , config : { variant : 'zoom-only' } } ,
306+ 'nextspace,zoom' : { type : 'zoom' , config : { variant : 'hybrid' } } ,
307+ default : { type : 'web' }
308+ }
309+ }
310+ const result = resolveConversationType ( { platforms : [ 'zoom' , 'nextspace' ] } , type )
311+ expect ( result . adapters ) . toHaveLength ( 1 )
312+ expect ( result . adapters [ 0 ] ) . toMatchObject ( { config : { variant : 'hybrid' } } )
313+ } )
314+
315+ test ( 'composite key matches regardless of platform order' , ( ) => {
316+ const type : ConversationType = {
317+ ...baseType ,
318+ properties : [ ] ,
319+ adapters : {
320+ 'nextspace,zoom' : { type : 'zoom' , config : { variant : 'hybrid' } } ,
321+ default : { type : 'web' }
322+ }
323+ }
324+ const result = resolveConversationType ( { platforms : [ 'nextspace' , 'zoom' ] } , type )
325+ expect ( result . adapters ) . toHaveLength ( 1 )
326+ expect ( result . adapters [ 0 ] ) . toMatchObject ( { config : { variant : 'hybrid' } } )
327+ } )
328+
329+ test ( 'falls back to per-platform adapters when no composite key matches' , ( ) => {
330+ const type : ConversationType = {
331+ ...baseType ,
332+ properties : [ ] ,
333+ adapters : {
334+ zoom : { type : 'zoom' } ,
335+ 'nextspace,zoom' : { type : 'zoom' , config : { variant : 'hybrid' } }
336+ }
337+ }
338+ // Only zoom platform — matches single 'zoom' key, not composite
339+ const result = resolveConversationType ( { platforms : [ 'zoom' ] } , type )
340+ expect ( result . adapters ) . toHaveLength ( 1 )
341+ expect ( result . adapters [ 0 ] ) . toMatchObject ( { type : 'zoom' } )
342+ expect ( ( result . adapters [ 0 ] as { config ?: { variant ?: string } } ) . config ?. variant ) . toBeUndefined ( )
343+ } )
299344 } )
300345
301346 describe ( 'passthrough fields' , ( ) => {
0 commit comments