Skip to content

[No QA] Remove unsafe type assertions from ReportSecondaryActionUtilsTest.ts#1

Closed
KJ21-ENG wants to merge 10000 commits into
mainfrom
sbf/manual-3e60941c-81e7-4ccd-a2dc-bf17daaac1df-94739-publication
Closed

[No QA] Remove unsafe type assertions from ReportSecondaryActionUtilsTest.ts#1
KJ21-ENG wants to merge 10000 commits into
mainfrom
sbf/manual-3e60941c-81e7-4ccd-a2dc-bf17daaac1df-94739-publication

Conversation

@KJ21-ENG

Copy link
Copy Markdown
Owner

Explanation of Change

Removed @typescript-eslint/no-unsafe-type-assertion violations from tests/unit/ReportSecondaryActionUtilsTest.ts as part of the cleanup for Expensify/App issue Expensify#94739.

What changed:

  • Replaced unsafe Report, Policy, and Transaction assertions with createMock<T>.
  • Replaced untyped mock callbacks and any casts with typed mock definitions.
  • Used jest.mocked for the isPolicyAdmin mocks.

Why this approach is safe:

  • Only test setup and typing changed.
  • Existing scenarios, fixtures, and assertions remain unchanged.
  • No production behavior is affected.

Reviewer focus:

  • Confirm the typed mocks preserve the existing test behavior and accepted argument types.

Fixed Issues

$ Expensify#94739
PROPOSAL: Expensify#94739 (comment)

Count change

Current baseline source:

  • config/eslint/eslint.seatbelt.tsv

Before:

  • tests/unit/ReportSecondaryActionUtilsTest.ts: 31 violations

After:

  • tests/unit/ReportSecondaryActionUtilsTest.ts: 0 violations

Net reduction:

  • 31 fewer @typescript-eslint/no-unsafe-type-assertion violations.

TSV evidence:

  • The generated TSV was restored byte-for-byte and is not included in this PR.

Tests

  1. Run:
    npm run lint -- --show-warnings tests/unit/ReportSecondaryActionUtilsTest.ts
  2. Run:
    CI=true npm run lint -- --no-cache --show-warnings tests/unit/ReportSecondaryActionUtilsTest.ts
  3. Run:
    npm run test -- tests/unit/ReportSecondaryActionUtilsTest.ts

The focused Jest suite passed all 165 tests. Focused lint, formatting, TSV restoration, and diff hygiene also passed.

Offline tests

Not applicable: this test-only cleanup adds no network behavior.

QA Steps

Not applicable: production behavior and UI are unchanged.

PR Author Checklist

  • I linked the correct issue above.
  • I included focused testing steps.
  • I verified that no production behavior changed.
  • I verified that the generated TSV was restored.
  • I confirmed that no screenshots are required for this test-only change.

Screenshots/Videos

Not applicable: only a unit-test source file changed.

stephanieelliott and others added 30 commits July 20, 2026 15:04
…-visibility

Docs updates for E/A#94698 clarify For you section hidden for new users
…anual-reimbursement

[No QA] Docs updates for E/A#92787 Authorized payer for manual reimbursement
…tch-4

[No QA] Update Concierge-Intelligence to remove exposed template bit
…f-44e2-8820-bef92bd1f751-94739-optionslistutilstest.tsx

[No QA] Remove unsafe type assertions from OptionsListUtilsTest.tsx tests
…a-4ecf-a452-d6f62b7d3c71-94739-reportprimaryactionutilstest.ts

[No QA] Remove unsafe type assertions from ReportPrimaryActionUtilsTest.ts tests
…rPhaseSetStateWarning

Co-authored-by: DylanDylann <DylanDylann@users.noreply.github.com>
…per localization of report names across various components.
…ion for display names in tooltips. Adjusted related components to utilize the new translation feature, improving user experience in reports and IOU request
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
# Conflicts:
#	config/eslint/eslint.seatbelt.tsv
rushatgabhane and others added 27 commits July 22, 2026 17:47
…-short-mentions-scan

perf: share scans across useShortMentionsList instances
eslint-config-expensify 4.0.7 added 'notation' to the rule's exception
list, so buildDotNotationPath is no longer flagged and the directive
became an unused-directive lint error on main.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Allow re-verifying an already-validated domain for non-admin domain members instead of showing a NotFoundPage page
…ed-eslint-disable

[No QA] Remove unused eslint-disable for no-negated-variables
…les-import-category-validation

Skip non-existent categories when importing merchant rules from spreadsheet
fix: Prevent "Maximum update depth exceeded" crash when selecting the same workspace while creating consecutive reports
fix: Message, sent in a new chat, displayed in the compose box after opening
…ecurityCopy

Replace user-facing "Magic code" copy with "Security code"
refactor getWorkspaceIcon to use translate from useLocalize
…ic-code-navigates-back-payment-v2

Fix magic code navigates back on payment (SettlementButton) v2
…rover

[Payment due @marufsharifi] [CP Staging] Stop nudging approvers to submit reports
…entalHelpDoc

[No QA] Remove rental cars from Consolidated Travel Billing help doc
…evice-occlusion-safety

[No QA] Update Agent Device interaction safety instructions
workspaceSection capped width unconditionally, cutting the rules list
narrower than before on layouts wider than workspaceSection but still
narrow (mWeb/tablet ~713-800px). Use workspaceSectionMobile there,
matching PolicyRulesPage's existing pattern.
Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
…firm-hidden-currency

[Copy Workspace Settings] Fix hidden currency in copy settings
…droidAuthToken

Fix QBO connect on Android by authenticating the native setup WebView
…ulesScrollbar

Fix scrollbar position on Rules Agents tab when rules exist
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e19a4374-ad92-48e1-815b-515aecc96c32

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sbf/manual-3e60941c-81e7-4ccd-a2dc-bf17daaac1df-94739-publication

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@KJ21-ENG

Copy link
Copy Markdown
Owner Author

Closing this malformed draft: it targeted the stale fork main and displayed unrelated history. The clean one-commit branch will be published against Expensify/App main.

@KJ21-ENG KJ21-ENG closed this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.