@@ -352,53 +352,6 @@ describe('Blocks Module', () => {
352352 expect ( typeof block ?. tools . config ?. tool ) . toBe ( 'function' )
353353 } )
354354 } )
355-
356- describe ( 'WebhookBlock' , ( ) => {
357- const block = getBlock ( 'webhook' )
358-
359- it ( 'should have correct metadata' , ( ) => {
360- expect ( block ?. type ) . toBe ( 'webhook' )
361- expect ( block ?. name ) . toBe ( 'Webhook' )
362- expect ( block ?. category ) . toBe ( 'triggers' )
363- expect ( block ?. authMode ) . toBe ( AuthMode . OAuth )
364- expect ( block ?. triggerAllowed ) . toBe ( true )
365- expect ( block ?. hideFromToolbar ) . toBe ( true )
366- } )
367-
368- it ( 'should have webhookProvider dropdown with multiple providers' , ( ) => {
369- const providerSubBlock = block ?. subBlocks . find ( ( sb ) => sb . id === 'webhookProvider' )
370- expect ( providerSubBlock ) . toBeDefined ( )
371- expect ( providerSubBlock ?. type ) . toBe ( 'dropdown' )
372- const options = providerSubBlock ?. options as Array < { label : string ; id : string } >
373- expect ( options ?. map ( ( o ) => o . id ) ) . toContain ( 'slack' )
374- expect ( options ?. map ( ( o ) => o . id ) ) . toContain ( 'generic' )
375- expect ( options ?. map ( ( o ) => o . id ) ) . toContain ( 'github' )
376- } )
377-
378- it ( 'should have conditional OAuth inputs' , ( ) => {
379- const gmailCredentialSubBlock = block ?. subBlocks . find ( ( sb ) => sb . id === 'gmailCredential' )
380- expect ( gmailCredentialSubBlock ) . toBeDefined ( )
381- expect ( gmailCredentialSubBlock ?. type ) . toBe ( 'oauth-input' )
382- expect ( gmailCredentialSubBlock ?. condition ) . toEqual ( {
383- field : 'webhookProvider' ,
384- value : 'gmail' ,
385- } )
386-
387- const outlookCredentialSubBlock = block ?. subBlocks . find (
388- ( sb ) => sb . id === 'outlookCredential'
389- )
390- expect ( outlookCredentialSubBlock ) . toBeDefined ( )
391- expect ( outlookCredentialSubBlock ?. type ) . toBe ( 'oauth-input' )
392- expect ( outlookCredentialSubBlock ?. condition ) . toEqual ( {
393- field : 'webhookProvider' ,
394- value : 'outlook' ,
395- } )
396- } )
397-
398- it ( 'should have empty tools access' , ( ) => {
399- expect ( block ?. tools . access ) . toEqual ( [ ] )
400- } )
401- } )
402355 } )
403356
404357 describe ( 'SubBlock Validation' , ( ) => {
@@ -545,8 +498,8 @@ describe('Blocks Module', () => {
545498 } )
546499
547500 it ( 'should handle blocks with triggerAllowed flag' , ( ) => {
548- const webhookBlock = getBlock ( 'webhook ' )
549- expect ( webhookBlock ?. triggerAllowed ) . toBe ( true )
501+ const gmailBlock = getBlock ( 'gmail ' )
502+ expect ( gmailBlock ?. triggerAllowed ) . toBe ( true )
550503
551504 const functionBlock = getBlock ( 'function' )
552505 expect ( functionBlock ?. triggerAllowed ) . toBeUndefined ( )
@@ -663,16 +616,6 @@ describe('Blocks Module', () => {
663616 expect ( temperatureSubBlock ?. min ) . toBe ( 0 )
664617 expect ( temperatureSubBlock ?. max ) . toBe ( 2 )
665618 } )
666-
667- it ( 'should have required scopes on OAuth inputs' , ( ) => {
668- const webhookBlock = getBlock ( 'webhook' )
669- const gmailCredentialSubBlock = webhookBlock ?. subBlocks . find (
670- ( sb ) => sb . id === 'gmailCredential'
671- )
672- expect ( gmailCredentialSubBlock ?. requiredScopes ) . toBeDefined ( )
673- expect ( Array . isArray ( gmailCredentialSubBlock ?. requiredScopes ) ) . toBe ( true )
674- expect ( ( gmailCredentialSubBlock ?. requiredScopes ?. length ?? 0 ) > 0 ) . toBe ( true )
675- } )
676619 } )
677620
678621 describe ( 'Block Consistency' , ( ) => {
0 commit comments