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:
Millian Lamiaux
2026-03-24 12:40:02 +01:00
parent a042c348c1
commit 4fa8be600c
12 changed files with 742 additions and 13 deletions

View File

@@ -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')}