Skip to content

Commit eed6092

Browse files
committed
remove outdated tests
1 parent c86fab9 commit eed6092

File tree

2 files changed

+2
-63
lines changed

2 files changed

+2
-63
lines changed

apps/sim/blocks/blocks.test.ts

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -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', () => {

apps/sim/blocks/registry.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ import { VisionBlock } from '@/blocks/blocks/vision'
130130
import { WaitBlock } from '@/blocks/blocks/wait'
131131
import { WealthboxBlock } from '@/blocks/blocks/wealthbox'
132132
import { WebflowBlock } from '@/blocks/blocks/webflow'
133-
import { WebhookBlock } from '@/blocks/blocks/webhook'
134133
import { WebhookRequestBlock } from '@/blocks/blocks/webhook_request'
135134
import { WhatsAppBlock } from '@/blocks/blocks/whatsapp'
136135
import { WikipediaBlock } from '@/blocks/blocks/wikipedia'
@@ -281,7 +280,6 @@ export const registry: Record<string, BlockConfig> = {
281280
wait: WaitBlock,
282281
wealthbox: WealthboxBlock,
283282
webflow: WebflowBlock,
284-
webhook: WebhookBlock,
285283
webhook_request: WebhookRequestBlock,
286284
whatsapp: WhatsAppBlock,
287285
wikipedia: WikipediaBlock,
@@ -296,11 +294,9 @@ export const registry: Record<string, BlockConfig> = {
296294
}
297295

298296
export const getBlock = (type: string): BlockConfig | undefined => {
299-
// Direct lookup first
300297
if (registry[type]) {
301298
return registry[type]
302299
}
303-
// Fallback: normalize hyphens to underscores (e.g., 'microsoft-teams' -> 'microsoft_teams')
304300
const normalized = type.replace(/-/g, '_')
305301
return registry[normalized]
306302
}

0 commit comments

Comments
 (0)