Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Feb 21, 2024
2 parents 68875d4 + 40acfc1 commit 1c6e8cb
Show file tree
Hide file tree
Showing 8 changed files with 613 additions and 85 deletions.
15 changes: 13 additions & 2 deletions example/src/LaunchScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,28 @@ export default function LaunchScreen(
<View key="run-tests" style={{ margin: 16 }}>
<Button
title="Run All Unit Tests"
onPress={() => navigation.navigate('test', { onlyGroups: false })}
onPress={() => navigation.navigate('test', { testSelection: 'all' })}
accessibilityLabel="Unit-tests"
/>
</View>
<View key="run-group-tests" style={{ margin: 16 }}>
<Button
title="Run Group Unit Tests"
onPress={() => navigation.navigate('test', { onlyGroups: true })}
onPress={() =>
navigation.navigate('test', { testSelection: 'groups' })
}
accessibilityLabel="Unit-group-tests"
/>
</View>
<View key="run-created-at-tests" style={{ margin: 16 }}>
<Button
title="Run Created At Unit Tests"
onPress={() =>
navigation.navigate('test', { testSelection: 'createdAt' })
}
accessibilityLabel="Unit-created-at-tests"
/>
</View>
<View style={styles.divider} />
<Text style={styles.title}>Test Conversations</Text>
<View style={styles.row}>
Expand Down
2 changes: 1 addition & 1 deletion example/src/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createNativeStackNavigator } from '@react-navigation/native-stack'

export type NavigationParamList = {
launch: undefined
test: { onlyGroups?: boolean }
test: { testSelection?: 'groups' | 'createdAt' | 'all' }
home: undefined
group: { id: string }
conversation: { topic: string }
Expand Down
24 changes: 20 additions & 4 deletions example/src/TestScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useRoute } from '@react-navigation/native'
import React, { useEffect, useState } from 'react'
import { View, Text, Button, ScrollView } from 'react-native'

import { createdAtTests } from './tests/createdAtTests'
import { groupTests } from './tests/groupTests'
import { tests, Test } from './tests/tests'

Expand Down Expand Up @@ -100,16 +101,31 @@ function TestView({
export default function TestScreen(): JSX.Element {
const [completedTests, setCompletedTests] = useState<number>(0)
const route = useRoute()
const params = route.params as { onlyGroups: boolean }
const allTests = tests.concat(groupTests)
const activeTests = params.onlyGroups ? groupTests : allTests
const params = route.params as {
testSelection: 'groups' | 'createdAt' | 'all'
}
const allTests = tests.concat(groupTests).concat(createdAtTests)
let activeTests, title
switch (params.testSelection) {
case 'groups':
activeTests = groupTests
title = 'Group Unit Tests'
break
case 'createdAt':
activeTests = createdAtTests
title = 'Created At Unit Tests'
break
default:
activeTests = allTests
title = 'All Unit Tests'
}

return (
<ScrollView>
<View>
<View style={{ padding: 12 }}>
<Text testID="Test View" accessible accessibilityLabel="Test View">
{params.onlyGroups ? 'Group Unit Tests' : 'All Unit Tests'}
{title}
</Text>
<View
style={{ flexDirection: 'row', justifyContent: 'space-between' }}
Expand Down
Loading

0 comments on commit 1c6e8cb

Please sign in to comment.