This clarifies that jobs.autoRun only *runs* already-queued jobs. It does not queue the jobs for you. Also adds an e2e test as this functionality had no e2e coverage
34 lines
712 B
TypeScript
34 lines
712 B
TypeScript
import type { Payload } from 'payload'
|
|
|
|
import path from 'path'
|
|
import { fileURLToPath } from 'url'
|
|
|
|
import { initPayloadInt } from '../helpers/initPayloadInt.js'
|
|
import { pagesSlug } from './config.js'
|
|
|
|
let payload: Payload
|
|
|
|
const filename = fileURLToPath(import.meta.url)
|
|
const dirname = path.dirname(filename)
|
|
|
|
describe('Collections - Plugins', () => {
|
|
beforeAll(async () => {
|
|
;({ payload } = await initPayloadInt(dirname))
|
|
})
|
|
|
|
afterAll(async () => {
|
|
await payload.destroy()
|
|
})
|
|
|
|
it('created pages collection', async () => {
|
|
const { id } = await payload.create({
|
|
collection: pagesSlug,
|
|
data: {
|
|
title: 'Test Page',
|
|
},
|
|
})
|
|
|
|
expect(id).toBeDefined()
|
|
})
|
|
})
|