github-actions[bot] opened a new pull request, #74979: URL: https://github.com/apache/airflow/pull/74979
Reading the selected value off a raw change event required casting event.target to HTMLInputElement, and for the enum/union-typed call sites a second `as` cast on top of that. Those casts are unchecked: a radio value renamed in the markup but not in the type still compiles and only breaks at runtime. Chakra v3's RadioCard.Root already hands the value to onValueChange, so narrowing can be done with a type predicate and the compiler verifies the value set matches the type. The predicate was being hand-written per call site, so it moves to src/utils/isOneOf.ts and narrows to the literal union of the values it is given. Where a generated API type already describes that union the values are checked against it, rather than a hand-maintained copy. Two CreateAssetEventModal tests had to await the submit button: the value now arrives through Ark UI's state machine, so the re-render no longer lands synchronously inside fireEvent. (cherry picked from commit fdf4adce2a3e04ad11f6ab262fcb36fb0ac36c42) Co-authored-by: Brent Bovenzi <[email protected]> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
