Repository navigation
[No QA] Remove unsafe type assertions from tests - #98111
Conversation
0523ce6 to
45af3bf
Compare
|
@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] |
|
@KJ21-ENG Please let me know when this is ready for review - as I noticed it was marked as draft again. |
|
@ikevin127 Could you please take a look at this when you get a chance? Thanks! |
Reviewer Checklist
|
ikevin127
left a comment
There was a problem hiding this comment.
🟢 LGTM
Clean 8th pass in the #94739 series (15 files, 41 → 0 no-unsafe-type-assertion).
The working tree is this PR's exact head (f883765f6f1), so I ran everything: 13 of 15 suites are fully green (369 tests). Two suites show 4 failures (ValidationUtilsTest future-date, 3 DeleteMoneyRequestTest TRIP-formula tests), but I confirmed those fail identically on main (base 65b633aa667) on my machine and are in tests this diff doesn't touch, so they're pre-existing local date/fake-timer environment flakes, not this PR.
No blockers, and I don't have an actionable code change to request ✅
|
🚀 Deployed to staging by https://github.com/blimpich in version: 9.4.54-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.54-4 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Removes all 41 tracked
@typescript-eslint/no-unsafe-type-assertionwarnings from 15 test files. The cleanup replaces unsafe assertions with production-derived mock signatures, typed fixtures, direct narrowing, production-linked expected values, and typed module access while preserving the existing test scenarios and runtime behavior.Fixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Tests
This is a test-only cleanup, so there are no manual product steps. On the exact signed head, focused Oxfmt and ESLint passed; all 15 focused Jest suites and 373 tests passed; project-aware TypeScript, differential Knip, React Compiler compliance, validateCode terminology, and changed-file spelling passed. Three fresh independent reviews found no scope, type-safety, or regression issues. Complete exact-head upstream PR CI reached two identical terminal snapshots with 26 technical successes, two conditional skips, and only the deferred manual independent-approval gate. No JS console behavior is changed.
Offline tests
N/A — only test code and test fixtures changed; no runtime network or offline behavior is modified.
QA Steps
N/A — the
[No QA]title is appropriate because all changed files are automated tests and no production behavior changes.Count change
The historical cleanup inventory at base
543e41e8cf7d23a0841c695f6402458a30907ad4recorded 41 target warnings. Against selected current main65b633aa667b1e22860b8a66bbbc93beece9de14, focused lint reproduced those 41 target warnings; the exact candidate reports zero. This manual recovery record is not canonical Seatbelt Lite evidence.Before:
tests/actions/BankAccountsTest.ts: 2tests/actions/IOUTest/DeleteMoneyRequestTest.ts: 2tests/actions/connections/QuickbooksDesktop.ts: 2tests/actions/connections/Xero.test.ts: 2tests/unit/PaymentUtilsTest.ts: 3tests/unit/ReportTitleUtilsTest.ts: 3tests/unit/Search/buildSubstitutionsMapTest.ts: 3tests/unit/SearchAutocompleteParserTest.ts: 3tests/unit/SplitExpenseAutoAdjustmentTest.ts: 3tests/unit/ValidationUtilsTest.ts: 3tests/unit/WhisperContentMentionContextTest.tsx: 3tests/unit/submitWithDismissFirstTest.ts: 3tests/unit/useReceiptHoverZoomTest.ts: 3tests/unit/useSidebarOrderedReportsTest.tsx: 3tests/unit/waitForPreviousRunsTest.ts: 3After:
tests/actions/BankAccountsTest.ts: 0tests/actions/IOUTest/DeleteMoneyRequestTest.ts: 0tests/actions/connections/QuickbooksDesktop.ts: 0tests/actions/connections/Xero.test.ts: 0tests/unit/PaymentUtilsTest.ts: 0tests/unit/ReportTitleUtilsTest.ts: 0tests/unit/Search/buildSubstitutionsMapTest.ts: 0tests/unit/SearchAutocompleteParserTest.ts: 0tests/unit/SplitExpenseAutoAdjustmentTest.ts: 0tests/unit/ValidationUtilsTest.ts: 0tests/unit/WhisperContentMentionContextTest.tsx: 0tests/unit/submitWithDismissFirstTest.ts: 0tests/unit/useReceiptHoverZoomTest.ts: 0tests/unit/useSidebarOrderedReportsTest.tsx: 0tests/unit/waitForPreviousRunsTest.ts: 0Net reduction:
TSV evidence: focused lint required zero target warnings in every changed file, and
config/eslint/eslint.seatbelt.tsvremains unchanged.PR Author Checklist
For this test-only cleanup, manual platform, offline, screenshot, design, asset, CSS, deeplink, Storybook, high-traffic, copy, message-editing, and product error-scenario items are N/A. Each item below was considered; applicable code-pattern, automated-test, issue-link, and verification requirements were completed.
### 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 production code changed.
Changed files (15)
tests/actions/BankAccountsTest.tstests/actions/IOUTest/DeleteMoneyRequestTest.tstests/actions/connections/QuickbooksDesktop.tstests/actions/connections/Xero.test.tstests/unit/PaymentUtilsTest.tstests/unit/ReportTitleUtilsTest.tstests/unit/Search/buildSubstitutionsMapTest.tstests/unit/SearchAutocompleteParserTest.tstests/unit/SplitExpenseAutoAdjustmentTest.tstests/unit/ValidationUtilsTest.tstests/unit/WhisperContentMentionContextTest.tsxtests/unit/submitWithDismissFirstTest.tstests/unit/useReceiptHoverZoomTest.tstests/unit/useSidebarOrderedReportsTest.tsxtests/unit/waitForPreviousRunsTest.ts