Skip to content

Commit a1ab1e3

Browse files
authored
chore: test case for upsert with auth in default (#1407)
1 parent 0d05609 commit a1ab1e3

File tree

1 file changed

+9
-0
lines changed
  • tests/integration/tests/enhancements/with-policy

1 file changed

+9
-0
lines changed

tests/integration/tests/enhancements/with-policy/auth.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,15 @@ describe('auth() runtime test', () => {
456456
await expect(
457457
db.post.create({ data: { title: 'post3', author: { connect: { email: '[email protected]' } } } })
458458
).resolves.toMatchObject({ authorId: 'userId-2' });
459+
460+
// upsert
461+
await expect(
462+
db.post.upsert({
463+
where: { id: 'post4' },
464+
create: { id: 'post4', title: 'post4' },
465+
update: { title: 'post4' },
466+
})
467+
).resolves.toMatchObject({ authorId: 'userId-1' });
459468
});
460469

461470
it('Default auth() with nested user context value', async () => {

0 commit comments

Comments
 (0)