Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
test(webhook): type the url validation table for both DTOs
Yudhi Armyndharis37b95e8e742b
diff --git a/src/modules/webhook/dto/webhook.dto.spec.ts b/src/modules/webhook/dto/webhook.dto.spec.tsindex 982e74aa7..30751ca24 100644--- a/src/modules/webhook/dto/webhook.dto.spec.ts+++ b/src/modules/webhook/dto/webhook.dto.spec.ts@@ -193,10 +193,10 @@ describe('webhook DTO url validation', () => {// The column is varchar(2048); PostgreSQL refuses a longer value on insert with a 500.const longUrl = (length: number) => 'https://x.example/' + 'a'.repeat(length - 'https://x.example/'.length);- const dtos = [+ const dtos: [string, new () => object][] = [['CreateWebhookDto', CreateWebhookDto],['UpdateWebhookDto', UpdateWebhookDto],- ] as const;+ ];it.each(dtos)('%s accepts http(s) URLs, dotless hosts included', async (_name, cls) => {for (const url of ['https://x.example/hook', 'http://localhost:3000/hook', longUrl(2048)]) {