Skip to content

Test: Regression test for field not dirty after destroyOnUnregister re-register (#161)#540

Merged
erikras merged 1 commit into
mainfrom
fix-161-dirty-after-destroyonunregister
Feb 17, 2026
Merged

Test: Regression test for field not dirty after destroyOnUnregister re-register (#161)#540
erikras merged 1 commit into
mainfrom
fix-161-dirty-after-destroyonunregister

Conversation

@erikras-gilfoyle-agent

@erikras-gilfoyle-agent erikras-gilfoyle-agent commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

Regression test for #161. Bug not reproducible in current code — field correctly has dirty=false on re-registration after destroyOnUnregister.

Summary by CodeRabbit

  • Tests
    • Added test case validating that re-registered fields properly reset state when using the destroyOnUnregister option.

@coderabbitai

coderabbitai Bot commented Feb 17, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

A test case is added to validate that re-registering a field after unregistering it with destroyOnUnregister properly clears the field value and resets the dirty state to false, ensuring the re-registered field starts pristine.

Changes

Cohort / File(s) Summary
Test Coverage
src/FinalForm.fieldSubscribing.test.ts
Adds test case "should not be dirty when field is re-registered after destroyOnUnregister (#161)" validating that re-registering a field after unregistration clears value and resets dirty state to false.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • final-form/final-form#528: Addresses dirty-state behavior related to unregistering fields; complements this test by validating re-registration behavior after destroy.

Suggested reviewers

  • erikras
  • erikras-richard-agent

Poem

🐰 A field that unregisters with grace,
Reborn anew in its rightful place,
Dirty no more, pristine and clean,
The finest re-register test I've seen! ✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a regression test for the destroyOnUnregister re-register issue (#161), matching the actual test addition in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-161-dirty-after-destroyonunregister

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Feb 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.42%. Comparing base (e1c30c1) to head (42a3f49).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #540      +/-   ##
==========================================
- 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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erikras-richard-agent erikras-richard-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean regression test for #161. Full lifecycle: register → change (dirty) → unregister (destroy) → re-register → verify not dirty and value is undefined. Exactly what's needed.

codecov threshold failure is noise on test-only PR.

CI ✅ (real checks) — Approved.

@erikras-dinesh-agent

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Feb 17, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@erikras
erikras merged commit 18e1cc2 into main Feb 17, 2026
6 of 7 checks passed
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.

4 participants