diff options
author | Paul Frazee <pfrazee@gmail.com> | 2024-05-13 14:20:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-13 14:20:27 -0700 |
commit | 27bb73c701d812b6ce85d230cd1433d8f6d51528 (patch) | |
tree | eec3c7ff601e87c17074731d166bc0dfcb222990 /src | |
parent | f0cd8ab6f46f45c79de5aaf6eb7def782dc99836 (diff) | |
download | voidsky-27bb73c701d812b6ce85d230cd1433d8f6d51528.tar.zst |
New onboarding tests (#3996)
* Add onboarding test * Add onboarding avatar-creator test * Update profile screen edit test
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/media/picker.e2e.tsx | 25 | ||||
-rw-r--r-- | src/view/com/testing/TestCtrls.e2e.tsx | 16 |
2 files changed, 25 insertions, 16 deletions
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, } } diff --git a/src/view/com/testing/TestCtrls.e2e.tsx b/src/view/com/testing/TestCtrls.e2e.tsx index 1c82a712e..135b7dee6 100644 --- a/src/view/com/testing/TestCtrls.e2e.tsx +++ b/src/view/com/testing/TestCtrls.e2e.tsx @@ -3,9 +3,9 @@ import {LogBox, Pressable, View} from 'react-native' import {useQueryClient} from '@tanstack/react-query' import {useModalControls} from '#/state/modals' -import {useSetFeedViewPreferencesMutation} from '#/state/queries/preferences' import {useSessionApi} from '#/state/session' import {useLoggedOutViewControls} from '#/state/shell/logged-out' +import {useOnboardingDispatch} from '#/state/shell/onboarding' import {navigate} from '../../../Navigation' LogBox.ignoreAllLogs() @@ -22,7 +22,7 @@ export function TestCtrls() { const queryClient = useQueryClient() const {logout, login} = useSessionApi() const {openModal} = useModalControls() - const {mutate: setFeedViewPref} = useSetFeedViewPreferencesMutation() + const onboardingDispatch = useOnboardingDispatch() const {setShowLoggedOut} = useLoggedOutViewControls() const onPressSignInAlice = async () => { await login( @@ -89,12 +89,6 @@ export function TestCtrls() { style={BTN} /> <Pressable - testID="e2eToggleMergefeed" - onPress={() => setFeedViewPref({lab_mergeFeedEnabled: true})} - accessibilityRole="button" - style={BTN} - /> - <Pressable testID="e2eRefreshHome" onPress={() => queryClient.invalidateQueries({queryKey: ['post-feed']})} accessibilityRole="button" @@ -112,6 +106,12 @@ export function TestCtrls() { accessibilityRole="button" style={BTN} /> + <Pressable + testID="e2eStartOnboarding" + onPress={() => onboardingDispatch({type: 'start'})} + accessibilityRole="button" + style={BTN} + /> </View> ) } |