[No QA] Fix unsafe type assertions in tests - #98555
Open
KJ21-ENG wants to merge 3 commits into
Open
Conversation
KJ21-ENG
marked this pull request as ready for review
August 14, 2026 08:02
Contributor
Author
|
@ikevin127 Could you please take a look at this when you get a chance? Thanks! |
|
@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] |
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 unsafe type assertions and assertion-equivalent test scaffolding across 15 test files while preserving their existing fixtures, mocks, UI expectations, and behavior. A single reserved test helper,
tests/utils/mockReanimatedModal.tsx, centralizes the repeated Reanimated modal mock needed by the cleaned tests.Fixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Count change
Current baseline source:
config/eslint/eslint.seatbelt.tsvat basec926b19748f5335a15809a0c14274c2e9f5e7aac.Before:
tests/ui/WorkspaceCategoriesTest.tsx: 2 violationstests/ui/WorkspaceMoreFeaturesPageTest.tsx: 2 violationstests/ui/WorkspaceTagsTest.tsx: 2 violationstests/ui/WorkspaceUpgradeTest.tsx: 2 violationstests/ui/WorkspaceWorkflowsPayerRowTest.tsx: 2 violationstests/ui/YearListItemHeaderTest.tsx: 2 violationstests/unit/AvatarUtilsTest.ts: 2 violationstests/unit/BulletListRendererTest.tsx: 2 violationstests/unit/ButtonStyleUtilsTest.ts: 2 violationstests/unit/ExpenseRuleUtilsTest.ts: 2 violationstests/unit/FraudProtectionTest.ts: 2 violationstests/unit/components/reportDetails/DynamicReportDetailsPageTest.tsx: 2 violationstests/unit/compoundParamsKeyTest.ts: 2 violationstests/unit/deferredLayoutWriteTest.ts: 2 violationstests/unit/hooks/confirmAction.test.ts: 2 violationsAfter:
tests/ui/WorkspaceCategoriesTest.tsx: 0 violationstests/ui/WorkspaceMoreFeaturesPageTest.tsx: 0 violationstests/ui/WorkspaceTagsTest.tsx: 0 violationstests/ui/WorkspaceUpgradeTest.tsx: 0 violationstests/ui/WorkspaceWorkflowsPayerRowTest.tsx: 0 violationstests/ui/YearListItemHeaderTest.tsx: 0 violationstests/unit/AvatarUtilsTest.ts: 0 violationstests/unit/BulletListRendererTest.tsx: 0 violationstests/unit/ButtonStyleUtilsTest.ts: 0 violationstests/unit/ExpenseRuleUtilsTest.ts: 0 violationstests/unit/FraudProtectionTest.ts: 0 violationstests/unit/components/reportDetails/DynamicReportDetailsPageTest.tsx: 0 violationstests/unit/compoundParamsKeyTest.ts: 0 violationstests/unit/deferredLayoutWriteTest.ts: 0 violationstests/unit/hooks/confirmAction.test.ts: 0 violationsNet reduction:
TSV evidence:
config/eslint/eslint.seatbelt.tsvbyte-for-byte after confirming zero cleanup findings in every target and the reserved support path.Tests
git diff --check, changed-path proof, and generated-TSV restoration passed.9ed615a6ee8e87422ff5a5ddd8a848db94caaa0f.N/A: this is test-only cleanup with no manual application flow or JS-console behavior to exercise.
Offline tests
N/A: this test-only cleanup does not change networking, offline behavior, or application runtime behavior.
QA Steps
N/A: the
[No QA]title is appropriate because this change only removes unsafe type assertions from tests and consolidates repeated test-only mock setup, with focused verification and exact-head CI coverage.PR Author Checklist
N/A rationale: manual platform, high-traffic-account, screenshots, assets, CSS, UI, copy, deeplink, Storybook, messaging, generic-component, feature/bug-flow, and post-review-main-merge checks do not apply because this PR changes only test code, introduces no product behavior, and has not merged
mainafter review. The applicable automated checks and independent reviews are recorded above. 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 runtime application behavior changed.
Changed files (16)
tests/ui/WorkspaceCategoriesTest.tsxtests/ui/WorkspaceMoreFeaturesPageTest.tsxtests/ui/WorkspaceTagsTest.tsxtests/ui/WorkspaceUpgradeTest.tsxtests/ui/WorkspaceWorkflowsPayerRowTest.tsxtests/ui/YearListItemHeaderTest.tsxtests/unit/AvatarUtilsTest.tstests/unit/BulletListRendererTest.tsxtests/unit/ButtonStyleUtilsTest.tstests/unit/ExpenseRuleUtilsTest.tstests/unit/FraudProtectionTest.tstests/unit/components/reportDetails/DynamicReportDetailsPageTest.tsxtests/unit/compoundParamsKeyTest.tstests/unit/deferredLayoutWriteTest.tstests/unit/hooks/confirmAction.test.tstests/utils/mockReanimatedModal.tsx(reserved support path)