[No QA] Remove unsafe type assertions from tests - #97634
Draft
KJ21-ENG wants to merge 1 commit into
Draft
Conversation
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 all 46 tracked
@typescript-eslint/no-unsafe-type-assertionwarnings from 15 test files. The cleanup replaces copied or erased types with production-derived mock signatures, typed fixtures, direct narrowing, 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. The exact signed head passed focused formatting, lint, all 15 focused Jest targets, three independent reviews, and Fork CI typecheck, lint, format, React Compiler, and Jest checks. 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
Current baseline source: the run-bound canonical tracked Seatbelt warning inventory for base
543e41e8cf7d23a0841c695f6402458a30907ad4.Before:
tests/ui/CountrySelectionListTest.tsx: 3tests/ui/CountrySelectorModalTest.tsx: 3tests/ui/DynamicContactMethodsPageTest.tsx: 4tests/ui/DynamicCountrySelectionPageTest.tsx: 3tests/ui/ForYouSectionTest.tsx: 3tests/ui/LocationPermissionModalTest.tsx: 3tests/ui/ScanSkipConfirmationTest.tsx: 3tests/ui/SearchReportAvatarTest.tsx: 3tests/ui/WorkEmailOnboarding.tsx: 3tests/unit/ContextMenuActionsCopyMessageTest.ts: 3tests/unit/ExportDownloadStatusModalTest.tsx: 3tests/unit/FocusTrapForModalTest.tsx: 3tests/unit/awaitStagingDeploysTest.ts: 3tests/unit/dismissModalAndOpenReportInInboxTabTest.ts: 3tests/unit/findUnusedStylesTest.ts: 3After:
tests/ui/CountrySelectionListTest.tsx: 0tests/ui/CountrySelectorModalTest.tsx: 0tests/ui/DynamicContactMethodsPageTest.tsx: 0tests/ui/DynamicCountrySelectionPageTest.tsx: 0tests/ui/ForYouSectionTest.tsx: 0tests/ui/LocationPermissionModalTest.tsx: 0tests/ui/ScanSkipConfirmationTest.tsx: 0tests/ui/SearchReportAvatarTest.tsx: 0tests/ui/WorkEmailOnboarding.tsx: 0tests/unit/ContextMenuActionsCopyMessageTest.ts: 0tests/unit/ExportDownloadStatusModalTest.tsx: 0tests/unit/FocusTrapForModalTest.tsx: 0tests/unit/awaitStagingDeploysTest.ts: 0tests/unit/dismissModalAndOpenReportInInboxTabTest.ts: 0tests/unit/findUnusedStylesTest.ts: 0Net reduction:
TSV evidence: the verifier generated the exact decrements, required zero warnings for every target, and restored
config/eslint/eslint.seatbelt.tsvunchanged.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/ui/CountrySelectionListTest.tsxtests/ui/CountrySelectorModalTest.tsxtests/ui/DynamicContactMethodsPageTest.tsxtests/ui/DynamicCountrySelectionPageTest.tsxtests/ui/ForYouSectionTest.tsxtests/ui/LocationPermissionModalTest.tsxtests/ui/ScanSkipConfirmationTest.tsxtests/ui/SearchReportAvatarTest.tsxtests/ui/WorkEmailOnboarding.tsxtests/unit/ContextMenuActionsCopyMessageTest.tstests/unit/ExportDownloadStatusModalTest.tsxtests/unit/FocusTrapForModalTest.tsxtests/unit/awaitStagingDeploysTest.tstests/unit/dismissModalAndOpenReportInInboxTabTest.tstests/unit/findUnusedStylesTest.ts