Skip to content

Conversation

@scottpchow23
Copy link
Contributor

@scottpchow23 scottpchow23 commented Nov 14, 2025

This change forwards value updates to the input tag's value attribute.

Prior to this change, the MonthInput did 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 DropdownMenu component to silence an error about invalid attributes being assigned on html tags via Popper.

@kermitapp
Copy link

kermitapp bot commented Nov 14, 2025

@scottpchow23 scottpchow23 requested a review from a team November 14, 2025 20:47
@scottpchow23 scottpchow23 force-pushed the OWNER-34-improve-month-input-testing-interface branch from 9756571 to 213d280 Compare November 14, 2025 20:52
@scottpchow23 scottpchow23 force-pushed the OWNER-34-improve-month-input-testing-interface branch from 213d280 to 0655c03 Compare November 14, 2025 20:53
@scottpchow23 scottpchow23 force-pushed the OWNER-34-improve-month-input-testing-interface branch from 0655c03 to ae6cebd Compare November 14, 2025 20:54
@scottpchow23 scottpchow23 requested a review from Copilot November 14, 2025 20:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 the onChange, setInputValue, and onBlur methods 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.

@github-actions
Copy link
Contributor

Released prerelease version 8.17.2-OWNER-34-improve-month-input-testing-interface-0e03e1b.0.
You may now run npm install @appfolio/react-gears@OWNER-34-improve-month-input-testing-interface

Copy link
Contributor

@appf-mike appf-mike left a comment

Choose a reason for hiding this comment

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

looks good to me, I'll use the prerelease of this to QA in tandem with our PR to bundle and report back here later

EDIT: lgtm

@appf-mike appf-mike force-pushed the OWNER-34-improve-month-input-testing-interface branch from 5341489 to 9780803 Compare November 21, 2025 17:50
@JeremyRH JeremyRH merged commit 8309e79 into master Nov 22, 2025
4 of 5 checks passed
@JeremyRH JeremyRH deleted the OWNER-34-improve-month-input-testing-interface branch November 22, 2025 02:57
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