Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Search onChange signature #177

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

langleyd
Copy link

@langleyd langleyd commented Jun 5, 2024

use React.ChangeEvent<HTMLInputElement> in the onChange signature of the Search component to avoid having to cast it in the application layer.

@langleyd langleyd requested a review from a team as a code owner June 5, 2024 13:54
@langleyd langleyd requested review from dbkr and t3chguy and removed request for a team June 5, 2024 13:54
Copy link

cloudflare-workers-and-pages bot commented Jun 5, 2024

Deploying compound-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 73ec7ac
Status: ✅  Deploy successful!
Preview URL: https://fa4c218d.compound-web.pages.dev
Branch Preview URL: https://langleyd-search-change-event.compound-web.pages.dev

View logs

const query = "my query";
await act(async () => {
const input = screen.getByRole("searchbox");
await userEvent.type(input, query);
Copy link
Member

Choose a reason for hiding this comment

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

As far as I understand, the user-event library handles this so it doesn't need to be wrapped in an act(). At least, user-event's examples don't use act(): https://testing-library.com/docs/user-event/intro/#writing-tests-with-userevent

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.

2 participants