chore: improper expect in upload test suite

This commit is contained in:
James
2024-04-02 14:21:58 -04:00
parent 44295ff248
commit 27dba7e4e1

View File

@@ -649,13 +649,12 @@ describe('Collections - Uploads', () => {
describe('filesRequiredOnCreate', () => {
// eslint-disable-next-line @typescript-eslint/require-await
it('should allow file to be optional if filesRequiredOnCreate is false', async () => {
expect(
async () =>
await payload.create({
collection: 'optional-file',
data: {},
}),
).not.toThrow()
const successfulCreate = await payload.create({
collection: 'optional-file',
data: {},
})
expect(successfulCreate.id).toBeDefined()
})
it('should throw an error if no file and filesRequiredOnCreate is true', async () => {