You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/queues/int.spec.ts
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -423,6 +423,32 @@ describe('Queues', () => {
423
423
expect(allSimples.docs[0].title).toBe('from single task')
424
424
})
425
425
426
+
it('can queue and run via the endpoint single tasks without workflows',async()=>{
427
+
constworkflowsRef=payload.config.jobs.workflows
428
+
deletepayload.config.jobs.workflows
429
+
awaitpayload.jobs.queue({
430
+
task: 'CreateSimple',
431
+
input: {
432
+
message: 'from single task',
433
+
},
434
+
})
435
+
436
+
awaitrestClient.GET('/payload-jobs/run',{
437
+
headers: {
438
+
Authorization: `JWT ${token}`,
439
+
},
440
+
})
441
+
442
+
constallSimples=awaitpayload.find({
443
+
collection: 'simple',
444
+
limit: 100,
445
+
})
446
+
447
+
expect(allSimples.totalDocs).toBe(1)
448
+
expect(allSimples.docs[0].title).toBe('from single task')
449
+
payload.config.jobs.workflows=workflowsRef
450
+
})
451
+
426
452
/*
427
453
// Task rollbacks are not supported in the current version of Payload. This test will be re-enabled when task rollbacks are supported once we figure out the transaction issues
428
454
it('transaction test against payload-jobs collection', async () => {
0 commit comments