OWNER-34 - Make MonthInput's value RTL compatible#1289
Merged
Conversation
|
Jira Issue: https://appfolio.atlassian.net/browse/OWNER-34 |
9756571 to
213d280
Compare
213d280 to
0655c03
Compare
0655c03 to
ae6cebd
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR makes the MonthInput component's value attribute compatible with React Testing Library by synchronizing the input element's value attribute with its internal state. This change enables DOM-based testing of the component's behavior.
Key Changes:
- Added
setAttribute('value', ...)calls in theonChange,setInputValue, andonBlurmethods to keep the DOM attribute in sync with the input's internal value - Added comprehensive test coverage using React Testing Library to verify the value attribute updates correctly for various user interactions
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/components/Input/MonthInput.js | Added setAttribute calls to sync value attribute with internal state; fixed prop name typo |
| src/components/Input/MonthInput.spec.js | Added new RTL compatibility test suite covering initial values, user input, and blur behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ae6cebd to
5341489
Compare
Contributor
|
Released prerelease version |
JeremyRH
approved these changes
Nov 14, 2025
appf-mike
approved these changes
Nov 20, 2025
5341489 to
9780803
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change forwards value updates to the input tag's
valueattribute.Prior to this change, the
MonthInputdid not forward it's value to the value attribute of the input tag itself. Because of this, it was impossible to verify behavior of this component via React Testing Library, which relies on DOM-visible state and not the input's internal value.It also corrects the props being passed to the
DropdownMenucomponent to silence an error about invalid attributes being assigned on html tags via Popper.