test: clean up email-nodemailer config

This commit is contained in:
Elliot DeNolf
2024-04-18 14:17:29 -04:00
parent 4acb133655
commit 83c617b452

View File

@@ -1,14 +1,8 @@
import { createNodemailerAdapter } from '@payloadcms/email-nodemailer' import { createNodemailerAdapter } from '@payloadcms/email-nodemailer'
import path from 'path'
import { getFileByPath } from 'payload/uploads'
import { fileURLToPath } from 'url'
import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js' import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
import { devUser } from '../credentials.js' import { devUser } from '../credentials.js'
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
export default buildConfigWithDefaults({ export default buildConfigWithDefaults({
// ...extend config here // ...extend config here
collections: [], collections: [],
@@ -27,14 +21,6 @@ export default buildConfigWithDefaults({
subject: 'This was sent on init', subject: 'This was sent on init',
}) })
// Create image payload.logger.info({ msg: 'Email sent', email })
const imageFilePath = path.resolve(dirname, '../uploads/image.png')
const imageFile = await getFileByPath(imageFilePath)
await payload.create({
collection: 'media',
data: {},
file: imageFile,
})
}, },
}) })