Skip to content

fix: resolve formatting and lint errors in SafeAreaViewWithHookTopInset test#28708

Merged
abretonc7s merged 2 commits intomainfrom
fix/formatting
Apr 13, 2026
Merged

fix: resolve formatting and lint errors in SafeAreaViewWithHookTopInset test#28708
abretonc7s merged 2 commits intomainfrom
fix/formatting

Conversation

@abretonc7s
Copy link
Copy Markdown
Contributor

@abretonc7s abretonc7s commented Apr 12, 2026

Description

Fix Prettier formatting violations and eslint errors in SafeAreaViewWithHookTopInset.test.tsx introduced by #28622. These break lint checks on any unrelated PR that touches this file.

Changes:

  • Reformat JSX to match Prettier config
  • Extract inline styles to StyleSheet.create to fix react-native/no-inline-styles
  • Replace require() with jest.requireActual() in jest.mock factory to fix @typescript-eslint/no-require-imports

Changelog

CHANGELOG entry: null

Related issues

Fixes lint/formatting regressions from #28622

Manual testing steps

Feature: SafeAreaViewWithHookTopInset test lint compliance

  Scenario: lint and tests pass on the test file
    Given the file app/shims/SafeAreaViewWithHookTopInset.test.tsx

    When running eslint on the file
    Then zero errors are reported

    When running jest on the file
    Then all 20 tests pass

Screenshots/Recordings

N/A — no visual changes, formatting and lint fixes only.

Before

6 eslint errors on main:

  • 2x @typescript-eslint/no-require-importsrequire() inside jest.mock factory
  • 4x react-native/no-inline-styles — inline style objects in test assertions

After

0 eslint errors, 0 eslint-disable comments, all 20 tests passing.

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Low risk: changes are confined to a Jest test file and only adjust mocks/style declarations to satisfy linting/formatting, without touching runtime code paths.

Overview
Cleans up SafeAreaViewWithHookTopInset.test.tsx to pass lint/format checks by switching jest.mock factories from require() to typed jest.requireActual() and tightening ref typings in the mock SafeAreaView.

Replaces inline style objects used in tests with a shared StyleSheet.create (testStyles) and applies minor Prettier-driven JSX/line-wrap formatting changes, leaving test coverage/behavior unchanged.

Reviewed by Cursor Bugbot for commit 00a20c7. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-perps Perps team label Apr 12, 2026
@abretonc7s abretonc7s marked this pull request as ready for review April 12, 2026 17:03
…et test

Fix Prettier formatting violations and eslint errors introduced by #28622.
These break lint checks on any PR that touches this file.

- Reformat JSX to match Prettier config
- Extract inline styles to StyleSheet.create (react-native/no-inline-styles)
- Replace require() with jest.requireActual() in jest.mock factory
@abretonc7s abretonc7s enabled auto-merge April 12, 2026 17:10
@github-actions github-actions bot added the risk-low Low testing needed · Low bug introduction risk label Apr 12, 2026
@abretonc7s abretonc7s requested a review from Cal-L April 12, 2026 17:14
Fixes TS2769 error from `ref: unknown` not assignable to `LegacyRef<View>`.
@github-actions github-actions bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 98%
click to see 🤖 AI reasoning details

E2E Test Selection:
The only changed file is app/shims/SafeAreaViewWithHookTopInset.test.tsx, which is a Jest unit test file. The changes are purely cosmetic/stylistic refactoring:

  1. Inline style objects extracted into StyleSheet.create() constants for better React Native testing practices
  2. Prettier-style code reformatting (removing unnecessary line breaks in JSX renders)
  3. TypeScript improvements using jest.requireActual with proper generics instead of require()

No application source code was modified. No E2E test infrastructure, controllers, Engine, navigation, or shared UI components were touched. All test assertions remain identical — this is a pure code quality improvement to a unit test file. No E2E tests need to run for this change.

Performance Test Selection:
No application source code was changed — only a unit test file was refactored. There is no performance impact whatsoever from this change.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@abretonc7s abretonc7s added this pull request to the merge queue Apr 13, 2026
Merged via the queue into main with commit d4daf1d Apr 13, 2026
67 checks passed
@abretonc7s abretonc7s deleted the fix/formatting branch April 13, 2026 00:32
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2026
@metamaskbot metamaskbot added the release-7.74.0 Issue or pull request that will be included in release 7.74.0 label Apr 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.74.0 Issue or pull request that will be included in release 7.74.0 risk-low Low testing needed · Low bug introduction risk size-S team-perps Perps team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants