test: add QA coverage — access unit tests, VideoPlayer snapshots, Maestro E2E flows, testIDs
- Add testIDs to explore, workout detail, and collection detail screens - Add testID prop to VideoPlayer component - Create access service unit tests (isFreeWorkout, canAccessWorkout) - Create VideoPlayer rendering snapshot tests (preview/background modes) - Create Maestro E2E flows: explore-freemium, collection-detail - Update tab-navigation flow with Explore screen assertions - Update profile-settings flow with real activity stat assertions - Update all-tests suite to include new flows
This commit is contained in:
@@ -77,6 +77,7 @@ function CollectionCard({
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
testID={`collection-card-${title.toLowerCase().replace(/\s+/g, '-')}`}
|
||||
style={styles.collectionCard}
|
||||
onPress={() => {
|
||||
haptics.buttonTap()
|
||||
@@ -121,6 +122,7 @@ function WorkoutCard({
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
testID={`workout-card-${workout.id}`}
|
||||
style={[styles.workoutCard, { borderColor: colors.border.glassLight }]}
|
||||
onPress={onPress}
|
||||
>
|
||||
@@ -138,7 +140,7 @@ function WorkoutCard({
|
||||
</View>
|
||||
|
||||
{isLocked && (
|
||||
<View style={styles.lockBadge}>
|
||||
<View testID={`lock-badge-${workout.id}`} style={styles.lockBadge}>
|
||||
<Ionicons name="lock-closed" size={10} color="#FFFFFF" />
|
||||
</View>
|
||||
)}
|
||||
@@ -279,8 +281,9 @@ export default function ExploreScreen() {
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={[styles.container, { backgroundColor: colors.bg.base, paddingTop: insets.top }]}>
|
||||
<View testID="explore-screen" style={[styles.container, { backgroundColor: colors.bg.base, paddingTop: insets.top }]}>
|
||||
<ScrollView
|
||||
testID="explore-scroll"
|
||||
style={styles.scrollView}
|
||||
contentContainerStyle={[styles.scrollContent, { paddingBottom: insets.bottom + 100 }]}
|
||||
showsVerticalScrollIndicator={false}
|
||||
@@ -295,7 +298,7 @@ export default function ExploreScreen() {
|
||||
</View>
|
||||
|
||||
{collections.length > 0 && (
|
||||
<View style={styles.collectionsSection}>
|
||||
<View testID="collections-section" style={styles.collectionsSection}>
|
||||
<StyledText size={22} weight="bold" color={colors.text.primary}>
|
||||
{t('screens:explore.collections')}
|
||||
</StyledText>
|
||||
@@ -320,7 +323,7 @@ export default function ExploreScreen() {
|
||||
)}
|
||||
|
||||
{featured.length > 0 && (
|
||||
<View style={styles.section}>
|
||||
<View testID="featured-section" style={styles.section}>
|
||||
<StyledText size={22} weight="bold" color={colors.text.primary}>
|
||||
{t('screens:explore.featured')}
|
||||
</StyledText>
|
||||
@@ -337,7 +340,7 @@ export default function ExploreScreen() {
|
||||
</View>
|
||||
)}
|
||||
|
||||
<View style={styles.filtersSection}>
|
||||
<View testID="filters-section" style={styles.filtersSection}>
|
||||
<View style={styles.filterHeader}>
|
||||
<StyledText size={22} weight="bold" color={colors.text.primary}>
|
||||
{t('screens:explore.allWorkouts')}
|
||||
|
||||
Reference in New Issue
Block a user