From 27bb73c701d812b6ce85d230cd1433d8f6d51528 Mon Sep 17 00:00:00 2001
From: Paul Frazee <pfrazee@gmail.com>
Date: Mon, 13 May 2024 14:20:27 -0700
Subject: New onboarding tests (#3996)

* Add onboarding test

* Add onboarding avatar-creator test

* Update profile screen edit test
---
 src/lib/media/picker.e2e.tsx | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

(limited to 'src/lib/media/picker.e2e.tsx')

diff --git a/src/lib/media/picker.e2e.tsx b/src/lib/media/picker.e2e.tsx
index 31702ab22..e6b46ba77 100644
--- a/src/lib/media/picker.e2e.tsx
+++ b/src/lib/media/picker.e2e.tsx
@@ -1,7 +1,11 @@
-import {Image as RNImage} from 'react-native-image-crop-picker'
 import RNFS from 'react-native-fs'
-import {CropperOptions} from './types'
+import {
+  Image as RNImage,
+  openCropper as openCropperFn,
+} from 'react-native-image-crop-picker'
+
 import {compressIfNeeded} from './manip'
+import {CropperOptions} from './types'
 
 async function getFile() {
   let files = await RNFS.readDir(
@@ -29,12 +33,17 @@ export async function openCamera(): Promise<RNImage> {
   return await getFile()
 }
 
-export async function openCropper(opts: CropperOptions): Promise<RNImage> {
+export async function openCropper(opts: CropperOptions) {
+  const item = await openCropperFn({
+    ...opts,
+    forceJpg: true, // ios only
+  })
+
   return {
-    path: opts.path,
-    mime: 'image/jpeg',
-    size: 123,
-    width: 4288,
-    height: 2848,
+    path: item.path,
+    mime: item.mime,
+    size: item.size,
+    width: item.width,
+    height: item.height,
   }
 }
-- 
cgit 1.4.1

