Collapsed forEach test loops and removed unnecessary isolation#27064
Collapsed forEach test loops and removed unnecessary isolation#27064
Conversation
Two NAV_ITEMS.forEach() loops were generating 14 per-test-isolated tests, each spinning up its own Ghost instance to assert the billing iframe is visible. Collapsed into 2 flow tests that iterate nav items within a single instance. Eliminates ~11 Ghost instance spinups per CI run — likely the single most expensive file in the e2e suite.
NAV_ITEMS.forEach() was generating 7 separate tests that each navigated to /ghost, clicked one link, and checked the URL. Now a single test iterates all nav items in sequence. Same assertions, 6 fewer tests.
Both tests create their own fixture data via createMany and operate on independent label operations. Test 1 adds a label, test 2 removes a different label — no shared state mutation that would cause interference under per-file isolation.
WalkthroughThe changes refactor multiple e2e test files to consolidate test structure. Three test files are modified: one removes the per-test isolation setup, and two others restructure their test organization by replacing dynamically generated per-item tests (using forEach and test.describe) with consolidated test cases that iterate over items using for...of loops. The test assertions and navigation interactions remain unchanged. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|



Summary
forEach collapse:
force-upgrade.test.ts: TwoNAV_ITEMS.forEach()loops were generating 14 per-test-isolated tests, each spinning up its own Ghost instance to assert the billing iframe is visible. Collapsed into 2 flow tests that iterate nav items within a single instance each. Eliminates ~11 Ghost instance spinups per CI run.navigation.test.ts:NAV_ITEMS.forEach()generating 7 tests collapsed into 1 flow test that iterates all items in sequence.ISO removal:
filter-actions.test.ts: RemovedusePerTestIsolation()— both tests create their own fixture data and operate on independent label operations with no shared state conflicts.No coverage removed. Every assertion is preserved, just grouped into fewer tests with fewer Ghost instances.
Net impact: ~19 fewer
test()calls, ~13 fewer Ghost instance spinups per CI run.Test plan