add a few test ids

This commit is contained in:
Hailey
2024-06-24 18:41:09 -07:00
parent 682f31ec9d
commit ce11bfaf63
5 changed files with 20 additions and 8 deletions
@@ -167,7 +167,8 @@ function CreateAnother() {
color="secondary"
size="small"
style={[a.self_center]}
onPress={() => navigation.navigate('StarterPackWizard')}>
onPress={() => navigation.navigate('StarterPackWizard')}
testID="createAnotherStarterpackBtn">
<ButtonText>
<Trans>Create another</Trans>
</ButtonText>
@@ -247,7 +248,8 @@ function Empty() {
size="small"
disabled={isGenerating}
onPress={confirmDialogControl.open}
style={{backgroundColor: 'transparent'}}>
style={{backgroundColor: 'transparent'}}
testID="createStarterpackForMeBtn">
<ButtonText style={{color: 'white'}}>
<Trans>Make one for me</Trans>
</ButtonText>
@@ -265,7 +267,8 @@ function Empty() {
borderColor: 'white',
width: 100,
}}
hoverStyle={[{backgroundColor: '#dfdfdf'}]}>
hoverStyle={[{backgroundColor: '#dfdfdf'}]}
testID="createStarterpackBtn">
<ButtonText>
<Trans>Create</Trans>
</ButtonText>
+1
View File
@@ -3,6 +3,7 @@ import {nativeApplicationVersion, nativeBuildVersion} from 'expo-application'
export const BUILD_ENV = process.env.EXPO_PUBLIC_ENV
export const IS_DEV = process.env.EXPO_PUBLIC_ENV === 'development'
export const IS_TESTFLIGHT = process.env.EXPO_PUBLIC_ENV === 'testflight'
export const IS_E2E = process.env.EXPO_PUBLIC_ENV === 'e2e'
// This is the commit hash that the current bundle was made from. The user can see the commit hash in the app's settings
// along with the other version info. Useful for debugging/reporting.
@@ -50,6 +50,7 @@ export function StepDetails() {
)}
value={state.name}
onChangeText={text => dispatch({type: 'SetName', name: text})}
testID="starterPackName"
/>
<TextField.SuffixText label={_(`${state.name?.length} out of 50`)}>
<Text style={[t.atoms.text_contrast_medium]}>
@@ -75,6 +76,7 @@ export function StepDetails() {
}
multiline
style={{minHeight: 150}}
testID="starterPackDescription"
/>
</TextField.Root>
</View>
+6 -3
View File
@@ -20,6 +20,7 @@ import {useFocusEffect, useNavigation} from '@react-navigation/native'
import {NativeStackScreenProps} from '@react-navigation/native-stack'
import {logger} from '#/logger'
import {IS_E2E} from 'lib/app-info'
import {HITSLOP_10} from 'lib/constants'
import {createSanitizedDisplayName} from 'lib/moderation/create-sanitized-display-name'
import {CommonNavigatorParams, NavigationProp} from 'lib/routes/types'
@@ -58,6 +59,8 @@ import {WizardEditListDialog} from '#/components/StarterPack/Wizard/WizardEditLi
import {Text} from '#/components/Typography'
import {Provider} from './State'
const MIN_PROFILES = IS_E2E ? 2 : 8
export function Wizard({
route,
}: NativeStackScreenProps<
@@ -399,7 +402,7 @@ function Footer({
(state.currentStep === 'Profiles' && items.length > 1) ||
(state.currentStep === 'Feeds' && items.length > 0)
const minimumItems = state.currentStep === 'Profiles' ? 8 : 0
const minimumItems = state.currentStep === 'Profiles' ? MIN_PROFILES : 0
const textStyles = [a.text_md]
@@ -528,11 +531,11 @@ function Footer({
) : (
<View style={{width: 70, height: 35}} />
)}
{state.currentStep === 'Profiles' && items.length < 8 ? (
{state.currentStep === 'Profiles' && items.length < MIN_PROFILES ? (
<>
<Text
style={[a.font_bold, textStyles, t.atoms.text_contrast_medium]}>
<Trans>Add {8 - items.length} more to continue</Trans>
<Trans>Add {MIN_PROFILES - items.length} more to continue</Trans>
</Text>
<View style={{width: 70}} />
</>
+5 -2
View File
@@ -27,7 +27,7 @@ import {useAgent, useSession} from '#/state/session'
import {useSetDrawerSwipeDisabled, useSetMinimalShellMode} from '#/state/shell'
import {useComposerControls} from '#/state/shell/composer'
import {useAnalytics} from 'lib/analytics/analytics'
import {IS_DEV, IS_TESTFLIGHT} from 'lib/app-info'
import {IS_DEV, IS_E2E, IS_TESTFLIGHT} from 'lib/app-info'
import {useSetTitle} from 'lib/hooks/useSetTitle'
import {ComposeIcon2} from 'lib/icons'
import {CommonNavigatorParams, NativeStackScreenProps} from 'lib/routes/types'
@@ -172,7 +172,10 @@ function ProfileScreenLoaded({
const setDrawerSwipeDisabled = useSetDrawerSwipeDisabled()
const gate = useGate()
const starterPacksEnabled =
IS_DEV || IS_TESTFLIGHT || (!isWeb && gate('starter_packs_enabled'))
IS_DEV ||
IS_TESTFLIGHT ||
IS_E2E ||
(!isWeb && gate('starter_packs_enabled'))
const [scrollViewTag, setScrollViewTag] = React.useState<number | null>(null)