[No QA] Remove unsafe type assertions from policy, workflow, navigation, and utility tests - #97317
Draft
KJ21-ENG wants to merge 4 commits into
Draft
[No QA] Remove unsafe type assertions from policy, workflow, navigation, and utility tests#97317KJ21-ENG wants to merge 4 commits into
KJ21-ENG wants to merge 4 commits into
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
This test-only cleanup removes 137 redundant
@typescript-eslint/no-unsafe-type-assertionfindings from the ten authorized test files. It replaces them with production-derived types, typed mocks, and key-specific Onyx fixtures while preserving the existing test scenarios and runtime behavior. Intentional malformed custom-unit error fixtures retain their exact backend payload through a localized typed helper.Fixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Count change
Current baseline source:
tests/actions/WorkflowTest.ts: 13 findingstests/navigation/getStateFromPathTests.ts: 14 findingstests/perf-test/useFilterFormValues.perf-test.tsx: 14 findingstests/unit/FileUtilsTest.ts: 13 findingstests/unit/PolicyUtilsTest.ts: 13 findingstests/unit/SearchEditMultipleUtilsTest.ts: 14 findingstests/unit/hooks/useAutoCreateSubmitWorkspace.test.ts: 13 findingstests/unit/navigateToWorkspacesPageTest.ts: 14 findingstests/unit/selectors/PolicyTest.ts: 15 findingstests/unit/usePolicyIndicatorChecksTest.ts: 14 findingsBefore:
@typescript-eslint/no-unsafe-type-assertionfindings across the ten target filesAfter:
@typescript-eslint/no-unsafe-type-assertionfindings in every target fileNet reduction:
TSV evidence:
config/eslint/eslint.seatbelt.tsvat base2c95456c78d65e54730dcde1f758292472ab59faprovides the baseline counts above. Final cleanup-count verification at exact headea332a6781c6813b874687ac0446634857edbb3ereported zero remaining findings for every target, and the tracked TSV was restored unchanged.Tests
useFilterFormValues.perf-test.tsxsuite passed: 1 suite and 11 tests, including Reassure verification.30431382868passed typecheck, lint, format, React Compiler, and Jest for exact headea332a6781c6813b874687ac0446634857edbb3e.Offline tests
Not applicable: this is a test-only type-safety cleanup and changes no product runtime or network behavior.
QA Steps
No QA required for this test-only cleanup; the title starts with
[No QA]and no staging or production manual QA was performed.PR Author Checklist
Checklist note: every item below is checked to record that it was considered. Platform, staging or production, offline, screenshot or video, high-traffic, and product-component testing are N/A for this test-only cleanup; no manual platform or product testing is claimed. 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 changes; no screenshots or videos were produced.
Changed files (10)
tests/actions/WorkflowTest.tstests/navigation/getStateFromPathTests.tstests/perf-test/useFilterFormValues.perf-test.tsxtests/unit/FileUtilsTest.tstests/unit/PolicyUtilsTest.tstests/unit/SearchEditMultipleUtilsTest.tstests/unit/hooks/useAutoCreateSubmitWorkspace.test.tstests/unit/navigateToWorkspacesPageTest.tstests/unit/selectors/PolicyTest.tstests/unit/usePolicyIndicatorChecksTest.ts