Skip to content

test: stabilize RemoteImage load tests#30424

Merged
Qbandev merged 1 commit into
mainfrom
infra-3513-remoteimage-stabilization
May 20, 2026
Merged

test: stabilize RemoteImage load tests#30424
Qbandev merged 1 commit into
mainfrom
infra-3513-remoteimage-stabilization

Conversation

@Qbandev

@Qbandev Qbandev commented May 20, 2026

Copy link
Copy Markdown
Contributor

Description

Stabilizes the RemoteImage unit tests by making mocked image load events explicit in the test file.

The previous setup could let the shared expo-image mock fire a timer-driven default load during tests. This change uses a passive local image mock, keeps unrelated IPFS resolution pending by default, and dispatches image load events through fireEvent.

Changelog

CHANGELOG entry: null

Related issues

Fixes: N/A

Manual testing steps

Feature: RemoteImage unit tests

  Scenario: RemoteImage load behavior is tested deterministically
    Given the RemoteImage unit test file
    When the targeted test suite runs
    Then image dimensions are asserted from explicit load events

Verification run:

git diff --check
yarn eslint app/components/Base/RemoteImage/index.test.tsx
yarn lint:tsc

Screenshots/Recordings

N/A. Test-only change.

Before

N/A.

After

N/A.

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android. N/A: test-only change.
  • I've tested with a power user scenario. N/A: test-only change.
  • I've instrumented key operations with Sentry traces for production performance metrics. N/A: test-only change.

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.

@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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes the RemoteImage unit tests by removing reliance on expo-image’s shared mock behavior and making image load (and IPFS URL resolution) deterministic within the test suite.

Changes:

  • Adds a local, passive expo-image mock to prevent timer-driven auto-onLoad behavior from affecting assertions.
  • Makes IPFS URL resolution “pending by default” in tests, with explicit overrides in IPFS-focused cases.
  • Replaces direct image.props.onLoad(...) calls with explicit fireEvent(..., 'load', ...) dispatches and removes now-unneeded fake-timer usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud

Copy link
Copy Markdown

@Qbandev Qbandev marked this pull request as ready for review May 20, 2026 08:49
@Qbandev Qbandev added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label May 20, 2026
@Qbandev Qbandev added this pull request to the merge queue May 20, 2026
Merged via the queue into main with commit 182a3b5 May 20, 2026
161 checks passed
@Qbandev Qbandev deleted the infra-3513-remoteimage-stabilization branch May 20, 2026 13:17
@github-actions github-actions Bot locked and limited conversation to collaborators May 20, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.79.0 Issue or pull request that will be included in release 7.79.0 label May 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.79.0 Issue or pull request that will be included in release 7.79.0 size-S team-dev-ops DevOps team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants