Skip to content

Commit 7c83f7c

Browse files
Copilotymc9
andauthored
Fix order-dependent assertions in slicing E2E tests (#2416)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
1 parent e5e452c commit 7c83f7c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/e2e/orm/client-api/slicing.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,9 @@ describe('Query slicing tests', () => {
505505
});
506506

507507
expect(user.posts).toHaveLength(2);
508-
expect(user.posts[0]!.title).toBe('Post 1');
508+
expect(user.posts).toEqual(
509+
expect.arrayContaining([expect.objectContaining({ title: 'Post 1' })])
510+
);
509511
});
510512

511513
it('allows nested update on included models', async () => {
@@ -545,7 +547,8 @@ describe('Query slicing tests', () => {
545547
include: { posts: true },
546548
});
547549

548-
expect(updated.posts[0]!.title).toBe('Updated Post');
550+
const updatedPost = updated.posts.find((p) => p.id === postId);
551+
expect(updatedPost!.title).toBe('Updated Post');
549552
});
550553
});
551554

0 commit comments

Comments
 (0)