fix(e2e): enable 9 skipped DB verification tests#55
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR adds three DB reset helpers ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Morph Preview Test⚡ Looks like you hit your rate limits! Please upgrade your limits here, or wait a few minutes and try again. If you need help, reach out to support@morphllm.com. Automated testing by Morph |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@e2e/logged-in/project-info-links.spec.ts`:
- Around line 422-475: The test "should verify links are persisted in database
after save" writes a new URL into projectinfo.links but lacks cleanup; add an
afterEach that restores projectinfo.links to seed data (for
PROJECT_INFO_IDS.projinfo3) using a helper (e.g., resetProjectInfoLinks) similar
to resetStatusListNames, invoking the DB update via the same query mechanism
(querySingle/update helper) so subsequent tests that inspect or count URLs are
not affected; implement resetProjectInfoLinks to set the links JSONB back to the
expected seed array and call it in an afterEach in project-info-links.spec.ts.
🧹 Nitpick comments (2)
e2e/logged-in/favorites.spec.ts (1)
128-168: NoafterEachreset foris_favorite— minor isolation gap.Unlike
board-settings.spec.ts(which resets board names viaafterEach), this test togglesis_favoritewithout restoring it. The test is self-contained (reads initial state, asserts flip), but if other tests on the same shard depend on a specific favorite state, this could cause flakiness. Low risk since the test reads current state dynamically.e2e/logged-in/remove-from-board.spec.ts (1)
188-232: Inline cleanup at line 231 won't run if the test fails before it.If the assertion at line 228 fails (e.g., card wasn't actually deleted),
resetRepoCards()at line 231 is skipped. Consider moving the post-test restore to anafterEachhook for guaranteed cleanup, similar to the pattern inboard-settings.spec.ts.♻️ Suggested: use afterEach for guaranteed cleanup
Wrap the DB verification test in its own
describeblock with anafterEach:+ test.describe('Database Verification', () => { + test.afterEach(async () => { + await resetRepoCards() + }) + test('should verify card is deleted from database after removal', async ({ page, }) => { // Ensure card-5 exists (may have been deleted by prior tests on same shard) await resetRepoCards() ... // Verify card is deleted from database const cardAfter = await querySingle('repocard', { id: cardId }) expect(cardAfter).toBeNull() - - // Restore card-5 for subsequent tests on same shard - await resetRepoCards() }) + })
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #55 +/- ##
=======================================
Coverage 74.53% 74.53%
=======================================
Files 118 118
Lines 3821 3821
Branches 1019 1019
=======================================
Hits 2848 2848
Misses 951 951
Partials 22 22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add resetProjectInfoLinks() helper and wrap DB verification test in describe block with afterEach to prevent persisted link data from contaminating subsequent tests.
🧪 E2E Coverage Report (Sharded: 12 parallel jobs)
📊 Full report available in workflow artifacts |
Summary
Changes
resetBoardNames(),resetStatusListNames()indb-query.tsfor cross-test isolationafterEachcleanuptest.skip()soft guards for CDP drag non-determinism in card-dnd and column-dndproject-info-links: Changed non-existentgithub→sentrypreset; fixed projectinfo ID mismatch (projinfo1→projinfo3)column-dnd: Fixed 0-indexedgrid_colassertion (1→0)remove-from-board: AddedresetRepoCardsUPSERT bookend for card restorationTest plan
Summary by CodeRabbit