diff --git a/packages/client/tests/functional/fluent-api/tests.ts b/packages/client/tests/functional/fluent-api/tests.ts index f2d350ee4f2a..d1e3a72ab5f7 100644 --- a/packages/client/tests/functional/fluent-api/tests.ts +++ b/packages/client/tests/functional/fluent-api/tests.ts @@ -149,6 +149,18 @@ testMatrix.setupTestSuite(() => { expect(posts).toEqual([expect.objectContaining({ title })]) }) + test('findFirstOrThrow where nested entity is not found', async () => { + const property = await prisma.user + .findFirstOrThrow({ + where: { + email, + }, + }) + .property() + + expect(property).toBeNull() + }) + test('findUniqueOrThrow', async () => { const posts = await prisma.user .findUniqueOrThrow({ @@ -161,6 +173,18 @@ testMatrix.setupTestSuite(() => { expect(posts).toEqual([expect.objectContaining({ title })]) }) + test('findUniqueOrThrow where nested entity is not found', async () => { + const property = await prisma.user + .findUniqueOrThrow({ + where: { + email, + }, + }) + .property() + + expect(property).toBeNull() + }) + test('create', async () => { const posts = await prisma.user .create({