Repository navigation
[No QA] Clean up unsafe assertions in test targets - #97493
Conversation
|
@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] |
Reviewer Checklist
|
ikevin127
left a comment
There was a problem hiding this comment.
🟢 LGTM - Only 1 non-blocking comment related to DRY ☝️
49 violations removed across 15 files using the established safe patterns, with strong reuse of the shared TestHelper write-spy helpers and production-derived types.
blimpich
left a comment
There was a problem hiding this comment.
Lets address Kevin's feedback
|
@blimpich My feedback was addressed ✅, on to you 🙌 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 blimpich has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/blimpich in version: 9.4.51-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.51-1 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
This test-only cleanup removes 49
@typescript-eslint/no-unsafe-type-assertionfindings from the 15 authorized test files. It replaces unsafe assertions with production-derived types, typed mocks and fixtures, and narrow handling for intentional runtime-versus-model boundaries while preserving the existing test scenarios and runtime behavior.Fixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Count change
Current baseline source:
config/eslint/eslint.seatbelt.tsvat base8960aa81fd37e54ae2d1493a3c9230b42751814brecords the baseline for@typescript-eslint/no-unsafe-type-assertion.Before:
server/victory-chart-renderer/tests/resolveCanvasSize.test.ts: 3 findingstests/actions/IOUTest/GetUpdateMoneyRequestParamsTest.ts: 3 findingstests/actions/IOUTest/UpdateMoneyRequestVendorTest.ts: 3 findingstests/actions/ReplaceOptimisticReportWithActualReportTest.ts: 3 findingstests/actions/connections/SageIntacct.ts: 3 findingstests/navigation/linkToHelpersTests.ts: 3 findingstests/navigation/useDynamicBackPathTests.ts: 3 findingstests/ui/AgentsPromoBannersTest.tsx: 3 findingstests/ui/AssignCardFeed.tsx: 3 findingstests/ui/components/HeaderViewTest.tsx: 3 findingstests/ui/components/SettlementButtonTest.tsx: 3 findingstests/unit/ReportActionsListPaddingViewTest.tsx: 4 findingstests/unit/SearchParserTest.ts: 4 findingstests/unit/SuggestionMentionTest.tsx: 4 findingstests/unit/showReportActionNotificationTest.ts: 4 findingsAfter:
Net reduction:
@typescript-eslint/no-unsafe-type-assertionfindings across the 15 target files.TSV evidence:
dc63a8f5a52d4af9c2debb8467419e76fe8e2eecreported zero remaining findings for every target, and the tracked TSV was restored unchanged.Tests
git diff --check.30849165059passed typecheck, lint, format, React Compiler, and Jest for headdc63a8f5a52d4af9c2debb8467419e76fe8e2eec.G, and the cumulative diff contains exactly the 15 authorized files.sha256:c191462103c8ad0a298105b817aa75c35d2bcdae5ba5c7631b1efa44a3ca021b.Offline tests
N/A — this is a test-only type-safety cleanup; it changes no application runtime or network behavior, and no manual offline test was performed.
QA Steps
N/A — this is a test-only cleanup; no staging or production manual QA was performed.
PR Author Checklist
Each checklist item below is checked because it was considered. Platform, staging or production, offline, screenshot or video, high-traffic, console, and product-component testing are N/A for this test-only cleanup; the automated evidence is listed in
### Tests.### 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; no screenshots or videos were produced.
Changed files (15)
server/victory-chart-renderer/tests/resolveCanvasSize.test.tstests/actions/IOUTest/GetUpdateMoneyRequestParamsTest.tstests/actions/IOUTest/UpdateMoneyRequestVendorTest.tstests/actions/ReplaceOptimisticReportWithActualReportTest.tstests/actions/connections/SageIntacct.tstests/navigation/linkToHelpersTests.tstests/navigation/useDynamicBackPathTests.tstests/ui/AgentsPromoBannersTest.tsxtests/ui/AssignCardFeed.tsxtests/ui/components/HeaderViewTest.tsxtests/ui/components/SettlementButtonTest.tsxtests/unit/ReportActionsListPaddingViewTest.tsxtests/unit/SearchParserTest.tstests/unit/SuggestionMentionTest.tsxtests/unit/showReportActionNotificationTest.ts