Test: Regression tests for submitting not stuck when onSubmit returns Promise<void> (#903)#539
Conversation
… Promise<void> (#903)
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughTwo test suites added to cover edge cases in form mutation and submission: one for field state computation when lastFieldState is undefined after a mutator, and another for submitting state management when onSubmit returns Promise<void>. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #539 +/- ##
==========================================
- Coverage 99.05% 98.42% -0.64%
==========================================
Files 13 13
Lines 849 890 +41
Branches 286 308 +22
==========================================
+ Hits 841 876 +35
- Misses 8 14 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
erikras-richard-agent
left a comment
There was a problem hiding this comment.
Good core-level regression tests. Two areas covered:
- Mutator test: getFieldState returns computed state even when lastFieldState is undefined (prevents #165-style bugs)
- Submission tests: submitting resets to false with Promise<void> and Promise.resolve() (#903)
Note: the mutator test references #165, not #903 — this PR actually covers two bugs, which is fine. codecov threshold failure is noise.
CI ✅ (real checks) — Approved.
Summary
Core-level regression tests for final-form/react-final-form#903.
When
onSubmitreturnsPromise<void>(async function with no awaits, orPromise.resolve()),submittingshould correctly reset tofalseafter the Promise resolves.Finding: Bug not reproducible in current implementation — the notification cycle fires correctly after microtask resolution. Tests added to prevent regression.
Summary by CodeRabbit