test(e2e): add WebhookFactory

This commit is contained in:
kolaente 2026-04-21 10:44:28 +02:00 committed by kolaente
parent fff7f80994
commit 3271c8600a
1 changed files with 20 additions and 0 deletions

View File

@ -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(),
}
}
}