Repository navigation
[NO QA] Reduce unsafe type assertions in tests via createMock (batch 2) - #94623
Conversation
|
apologies @lakchote this should've been opened as a draft PR first |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a2025b524e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…uceUnsafeTypeAssertionsBatch2
Codecov Report✅ All modified and coverable lines are covered by tests. |
|
🚧 lakchote has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/lakchote in version: 9.4.21-2 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.4.21-9 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Some test files build fake data with a cast that switches off TypeScript's checking, which was quietly hiding real mistakes in that fake data (wrong field names, numbers where text belongs, fields that don't exist). This PR moves the 7 worst-offending test files onto a small typed helper (
createMock) that keeps the checking on, and fixes every mistake it surfaces — about 518 fewer unchecked spots, with no change to how the app behaves (test-only).Fixed Issues
For #92882
PROPOSAL:
Tests
Test-only.
tsgoand the eslint-seatbelt frozen check pass; the migrated suites run in CI.Offline tests
N/A — no runtime changes.
QA Steps
[NO QA] — test-only, no user-facing impact.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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
Android: Native
N/A — test-only change, no UI.
Android: mWeb Chrome
N/A — test-only change, no UI.
iOS: Native
N/A — test-only change, no UI.
iOS: mWeb Safari
N/A — test-only change, no UI.
MacOS: Chrome / Safari
N/A — test-only change, no UI.
– written by Claude on Ben's behalf