Remove unneeded getImageDimensions helper function. (#3200)

* Remove unneeded `getImageDimensions` helper function.

The built-in React Native function has an `async` API that we can call directly.

* Legit test failure

* Import Image from React Native

* Prefer using styledComponents.Image.getSize

* Revert "Prefer using styledComponents.Image.getSize"

This reverts commit 103ca9b3ef.
This commit is contained in:
Corey Farwell
2025-12-12 04:58:42 -05:00
committed by GitHub
parent 8f97ae197f
commit c36c94a5df
4 changed files with 5 additions and 22 deletions

View File

@@ -6,9 +6,7 @@ import { Image } from "react-native";
import factory from "tests/factory";
import faker from "tests/helpers/faker";
Image.getSize = jest.fn( ( uri, callback ) => {
callback( { width: 1024, height: 768 } );
} );
Image.getSize = jest.fn( ( _uri, _callback ) => async () => ( { width: 1024, height: 768 } ) );
const mockObservation = factory( "LocalObservation", {
created_at: "2022-11-27T19:07:41-08:00",