Fix unsafe type assertions in AgreementsFullStep - #98842
Draft
KJ21-ENG wants to merge 1 commit into
Draft
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
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.
Explanation of Change
Removes eight unsafe type assertions from
AgreementsFullStep. Agreement field IDs now retain their compile-time relationship to each caller's form keys, and required-field errors are detected from the existinggetFieldRequiredErrorsresult. The four checkbox IDs, validation behavior, custom error messages, draft handling, bank-statement validation, and rendered order are unchanged.Fixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Count change
Current baseline source:
config/eslint/eslint.seatbelt.tsvat basee69182c5379d82f41b6c9d6b7c7237d2c1cb0dd1.Before:
src/components/SubStepForms/AgreementsFullStep.tsx: 8 violationsAfter:
src/components/SubStepForms/AgreementsFullStep.tsx: 0 violationsNet reduction:
TSV evidence:
config/eslint/eslint.seatbelt.tsvbyte-for-byte after confirming zero cleanup findings in the target.Tests
src/components/SubStepForms/AgreementsFullStep.tsx.src/components/AddressSearch/index.tsx.git diff --check, changed-path proof, and generated-TSV restoration passed.32105010856passed typecheck, lint, format, React Compiler, and Jest at signed commit0293a7ece3647a5919384a552462b884e6ef96a0.No manual application testing was performed; the evidence above is automated verification and independent review.
Offline tests
N/A: the agreement form is already disabled offline, this cleanup does not change networking or offline behavior, and no manual offline testing was performed.
QA Steps
PR Author Checklist
N/A rationale: no product behavior, copy, CSS, assets, networking, deeplink, Storybook story, messaging flow, generic component, or new feature/bug flow is intended to change. No manual platform, high-traffic-account, offline, console, screenshot/video, staging, or production testing was performed. Both existing callers and the agreement validation behavior were examined during planning and independent review, and exact-head CI covered the full repository checks. Every item below was considered against that scope.
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
N/A: no UI or visual behavior changed, and no screenshots or videos were produced.
Changed files (1)
src/components/SubStepForms/AgreementsFullStep.tsx