From 3271c8600adc42c7ce81ff21b16c26a6eb409fc0 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 21 Apr 2026 10:44:28 +0200 Subject: [PATCH] test(e2e): add WebhookFactory --- frontend/tests/factories/webhook.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 frontend/tests/factories/webhook.ts diff --git a/frontend/tests/factories/webhook.ts b/frontend/tests/factories/webhook.ts new file mode 100644 index 000000000..3868cbc00 --- /dev/null +++ b/frontend/tests/factories/webhook.ts @@ -0,0 +1,20 @@ +import {faker} from '@faker-js/faker' +import {Factory} from '../support/factory' + +// The `events` column is a JSON-serialized string in XORM; pass it pre-encoded. +export class WebhookFactory extends Factory { + static table = 'webhooks' + + static factory() { + const now = new Date() + return { + id: '{increment}', + project_id: 1, + target_url: faker.internet.url(), + events: JSON.stringify(['task.created']), + created_by_id: 1, + created: now.toISOString(), + updated: now.toISOString(), + } + } +}