[No QA] Remove redundant unsafe type assertions from test suites - #97290
Open
KJ21-ENG wants to merge 3 commits into
Open
[No QA] Remove redundant unsafe type assertions from test suites#97290KJ21-ENG wants to merge 3 commits into
KJ21-ENG wants to merge 3 commits into
Conversation
KJ21-ENG
marked this pull request as ready for review
July 31, 2026 14:27
|
@ikevin127 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Contributor
Reviewer Checklist
|
ikevin127
approved these changes
Aug 2, 2026
ikevin127
left a comment
Contributor
There was a problem hiding this comment.
🟢 LGTM - Careful, well-executed test-only cleanup. No production code touched. I ran all ten suites locally against the checked-out head branch: 149/149 pass.
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
This test-only cleanup removes redundant unsafe type assertions from ten
existing test suites. It replaces them with production-derived signatures and
repository-native typed fixtures while preserving each test scenario and
runtime behavior. The MFA mock retains a typed forwarding wrapper so Jest's
hoisted module factory exposes a callable export.
Fixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Count change
Current baseline source:
config/eslint/eslint.seatbelt.tsv— the restored canonical tracked TSV recorded 8 unsafe type assertion violations for each target before cleanup.Before:
tests/ui/MultifactorAuthenticationRevokePageTest.tsx: 8 violationstests/ui/components/LHNOptionsListTest.tsx: 8 violationstests/unit/MentionUserRendererTest.tsx: 8 violationstests/unit/MoneyRequestReportUtilsTest.ts: 8 violationstests/unit/Navigation/guards/OnboardingGuard.test.ts: 8 violationstests/unit/getReportPreviewSenderIDTest.ts: 8 violationstests/unit/hooks/useBulkDuplicateReportActionTest.ts: 8 violationstests/unit/hooks/useFreeTrial.test.ts: 8 violationstests/unit/hooks/useIsAllowedToIssueCompanyCard.test.ts: 8 violationstests/unit/navigateAfterExpenseCreateTest.ts: 8 violationsAfter:
tests/ui/MultifactorAuthenticationRevokePageTest.tsx: 0 violationstests/ui/components/LHNOptionsListTest.tsx: 0 violationstests/unit/MentionUserRendererTest.tsx: 0 violationstests/unit/MoneyRequestReportUtilsTest.ts: 0 violationstests/unit/Navigation/guards/OnboardingGuard.test.ts: 0 violationstests/unit/getReportPreviewSenderIDTest.ts: 0 violationstests/unit/hooks/useBulkDuplicateReportActionTest.ts: 0 violationstests/unit/hooks/useFreeTrial.test.ts: 0 violationstests/unit/hooks/useIsAllowedToIssueCompanyCard.test.ts: 0 violationstests/unit/navigateAfterExpenseCreateTest.ts: 0 violationsNet reduction:
TSV evidence:
Tests
tests/unit/hooks/useFreeTrial.test.ts; 17 tests passed.Offline tests
N/A — this PR changes test typing only; it changes no product runtime or network behavior.
QA Steps
N/A — this is a test-only cleanup and the title uses
[No QA].PR Author Checklist
### 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 changes; this test-only cleanup does not require screenshots or videos.
Changed files (10)
tests/ui/MultifactorAuthenticationRevokePageTest.tsxtests/ui/components/LHNOptionsListTest.tsxtests/unit/MentionUserRendererTest.tsxtests/unit/MoneyRequestReportUtilsTest.tstests/unit/Navigation/guards/OnboardingGuard.test.tstests/unit/getReportPreviewSenderIDTest.tstests/unit/hooks/useBulkDuplicateReportActionTest.tstests/unit/hooks/useFreeTrial.test.tstests/unit/hooks/useIsAllowedToIssueCompanyCard.test.tstests/unit/navigateAfterExpenseCreateTest.ts