Skip to content

Fix order-dependent assertions in slicing E2E tests#2416

Merged
ymc9 merged 2 commits intodevfrom
copilot/sub-pr-2414-again
Feb 27, 2026
Merged

Fix order-dependent assertions in slicing E2E tests#2416
ymc9 merged 2 commits intodevfrom
copilot/sub-pr-2414-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 27, 2026

To-many relation arrays returned by the ORM have no guaranteed ordering, making index-based assertions in E2E tests non-deterministic and potentially flaky across providers/query plans.

Changes

  • Membership assertion for multi-row array: replaced posts[0].title === 'Post 1' with expect.arrayContaining([expect.objectContaining({ title: 'Post 1' })]) so the check passes regardless of row order
  • Id-based lookup for updated post: replaced posts[0].title with posts.find(p => p.id === postId) to locate the specific post by its known id rather than relying on position

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues raised in PR #2414 review Fix order-dependent assertions in slicing E2E tests Feb 27, 2026
@ymc9 ymc9 marked this pull request as ready for review February 27, 2026 19:26
@ymc9 ymc9 merged commit 7c83f7c into dev Feb 27, 2026
6 of 7 checks passed
@ymc9 ymc9 deleted the copilot/sub-pr-2414-again branch February 27, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants