Remove email outbox collection and process job; refactor email templates with rich text support and slug generation

This commit is contained in:
2025-09-13 12:11:35 +02:00
parent ed9d979d3e
commit 3868e74770
34 changed files with 2674 additions and 374 deletions

View File

@@ -4,7 +4,7 @@ import config from '@payload-config'
import { createPayloadRequest, getPayload } from 'payload'
import { afterAll, beforeAll, describe, expect, test } from 'vitest'
import { customEndpointHandler } from '../src/endpoints/customEndpointHandler.js'
// import { customEndpointHandler } from '../src/endpoints/customEndpointHandler.js'
let payload: Payload
@@ -17,19 +17,11 @@ beforeAll(async () => {
})
describe('Plugin integration tests', () => {
test('should query custom endpoint added by plugin', async () => {
const request = new Request('http://localhost:3000/api/my-plugin-endpoint', {
method: 'GET',
})
const payloadRequest = await createPayloadRequest({ config, request })
const response = await customEndpointHandler(payloadRequest)
expect(response.status).toBe(200)
const data = await response.json()
expect(data).toMatchObject({
message: 'Hello from custom endpoint',
})
test('should have mailing plugin initialized', async () => {
expect(payload).toBeDefined()
expect((payload as any).mailing).toBeDefined()
expect((payload as any).mailing.service).toBeDefined()
expect((payload as any).mailing.config).toBeDefined()
})
test('can create post with custom text field added by plugin', async () => {