PolicyEngine / policyengine-app

PolicyEngine's free web app for computing the impact of public policy.
GNU Affero General Public License v3.0
32 stars 86 forks source link

Added escape key handler #1680

Closed czhou578 closed 2 weeks ago

czhou578 commented 2 weeks ago

Description

Fixes #1656

Changes

I added an event handler to handle the case when the user presses the escape key when editing their username on the UserProfile page. Before I started editing, it seemed like the "Enter" button was already working, strangely, so I went straight to handling the escape.

Screenshots

[

https://github.com/PolicyEngine/policyengine-app/assets/42430035/c2c08405-c319-42eb-bb72-ef83d2d46c87

](url)

Tests

No new tests were added.

czhou578 commented 2 weeks ago

@anth-volk, seems like some things in the jest files are now deprecated. I believe some of the dependabot pull requests currently pending can fix this. Could you check that out?

anth-volk commented 2 weeks ago

@czhou578 It appears the full failure is actually due to an API timeout - unfortunately, I've yet to find any way of just fetching metadata once and passing it to all test files, and sometimes this timeout does occur in the components themselves. That said, there are a ton of errors for soon-to-be deprecated Jest features, which I'll open in a separate issue.

czhou578 commented 2 weeks ago

Ok. It seems like the CI tests passed already. I can take the issue of updating Jest, since I would like to improve my knowledge of unit testing. Is that ok?

anth-volk commented 2 weeks ago

And sure, please feel free to handle the updating of Jest