absorb ios e2e tap offset

This commit is contained in:
Samuel Newman
2026-07-28 18:08:02 +03:00
parent 8f7f90ebc4
commit f30db0ad06
+82 -77
View File
@@ -16,9 +16,12 @@ LogBox.ignoreAllLogs()
* of the tests dramatically. * of the tests dramatically.
*/ */
const BTN = Platform.select({ const BTN = {height: 1, width: 1, backgroundColor: 'red'}
ios: {height: 8, width: 8, backgroundColor: 'red'}, // The iOS dev client reports these accessibility frames ~16pt right and 34pt
default: {height: 1, width: 1, backgroundColor: 'red'}, // above their hit-test frames. At 80pt, either frame's center hits the control.
const SIGN_IN_BTN = Platform.select({
ios: {height: 80, width: 80, backgroundColor: 'red'},
default: BTN,
}) })
/* /*
@@ -72,91 +75,93 @@ export function TestCtrls() {
setShowLoggedOut(false) setShowLoggedOut(false)
} }
return ( return (
<View <>
style={{
position: 'absolute',
top: 100,
right: Platform.OS === 'ios' ? 24 : 0,
zIndex: 100,
}}>
{isProxyConfigured && ( {isProxyConfigured && (
<> <View
style={[
{position: 'absolute', top: 100, zIndex: 100},
Platform.OS === 'ios' ? {left: 0} : {right: 0},
]}>
<Pressable <Pressable
testID="e2eSignInAlice" testID="e2eSignInAlice"
onPress={onPressSignInAlice} onPress={onPressSignInAlice}
accessibilityRole="button" accessibilityRole="button"
style={BTN} style={SIGN_IN_BTN}
/> />
<Pressable <Pressable
testID="e2eSignInBob" testID="e2eSignInBob"
onPress={onPressSignInBob} onPress={onPressSignInBob}
accessibilityRole="button" accessibilityRole="button"
style={BTN} style={SIGN_IN_BTN}
/> />
</> </View>
)} )}
<Pressable <View style={{position: 'absolute', top: 102, right: 0, zIndex: 100}}>
testID="e2eSignOut" <Pressable
onPress={() => logoutEveryAccount('Settings')} testID="e2eSignOut"
accessibilityRole="button" onPress={() => logoutEveryAccount('Settings')}
style={BTN} accessibilityRole="button"
/> style={BTN}
<Pressable />
testID="e2eGotoHome" <Pressable
onPress={() => navigate('Home')} testID="e2eGotoHome"
accessibilityRole="button" onPress={() => navigate('Home')}
style={BTN} accessibilityRole="button"
/> style={BTN}
<Pressable />
testID="e2eGotoSettings" <Pressable
onPress={() => navigate('Settings')} testID="e2eGotoSettings"
accessibilityRole="button" onPress={() => navigate('Settings')}
style={BTN} accessibilityRole="button"
/> style={BTN}
<Pressable />
testID="e2eGotoModeration" <Pressable
onPress={() => navigate('Moderation')} testID="e2eGotoModeration"
accessibilityRole="button" onPress={() => navigate('Moderation')}
style={BTN} accessibilityRole="button"
/> style={BTN}
<Pressable />
testID="e2eGotoLists" <Pressable
onPress={() => navigate('Lists')} testID="e2eGotoLists"
accessibilityRole="button" onPress={() => navigate('Lists')}
style={BTN} accessibilityRole="button"
/> style={BTN}
<Pressable />
testID="e2eGotoFeeds" <Pressable
onPress={() => navigate('Feeds')} testID="e2eGotoFeeds"
accessibilityRole="button" onPress={() => navigate('Feeds')}
style={BTN} accessibilityRole="button"
/> style={BTN}
<Pressable />
testID="storybookBtn" <Pressable
onPress={() => navigate('Debug')} testID="storybookBtn"
accessibilityRole="button" onPress={() => navigate('Debug')}
style={BTN} accessibilityRole="button"
/> style={BTN}
<Pressable />
testID="e2eRefreshHome" <Pressable
onPress={() => queryClient.invalidateQueries({queryKey: ['post-feed']})} testID="e2eRefreshHome"
accessibilityRole="button" onPress={() =>
style={BTN} queryClient.invalidateQueries({queryKey: ['post-feed']})
/> }
<Pressable accessibilityRole="button"
testID="e2eOpenLoggedOutView" style={BTN}
onPress={() => setShowLoggedOut(true)} />
accessibilityRole="button" <Pressable
style={BTN} testID="e2eOpenLoggedOutView"
/> onPress={() => setShowLoggedOut(true)}
<Pressable accessibilityRole="button"
testID="e2eStartOnboarding" style={BTN}
onPress={() => { />
onboardingDispatch({type: 'start'}) <Pressable
}} testID="e2eStartOnboarding"
accessibilityRole="button" onPress={() => {
style={BTN} onboardingDispatch({type: 'start'})
/> }}
</View> accessibilityRole="button"
style={BTN}
/>
</View>
</>
) )
} }