test(e2e): add WebhookFactory
This commit is contained in:
parent
fff7f80994
commit
3271c8600a
|
|
@ -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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue