diff --git a/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTest.js b/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTest.js index 0e90e06987b1b1..92389f36b81288 100644 --- a/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTest.js +++ b/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTest.js @@ -37,14 +37,18 @@ export default function RNTesterPlatformTest(props: Props): React.MixedElement { return ( - {title} - {description} - - - + + {title} + + {description} + + + + + void, + style?: ?ViewStyleProp, +|}>; +export default function RNTesterPlatformTestMinimizedResultView({ + numFail, + numError, + numPass, + numPending, + onPress, + style, +}: Props): React.MixedElement { + return ( + + + + + {numPass} Pass + + + {numFail} Fail + + + {numError} Error + + + {numPending} Pending + + + + + + ); +} + +const styles = StyleSheet.create({ + caret: { + fontSize: 24, + transform: [{translateY: 4}], + marginEnd: 8, + opacity: 0.5, + }, + errorText: { + color: 'orange', + }, + failText: { + color: 'red', + }, + innerContainer: { + width: '100%', + height: '100%', + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between', + paddingHorizontal: 8, + backgroundColor: 'white', + }, + passText: { + color: 'green', + }, + pendingText: { + color: 'gray', + }, + root: { + borderTopColor: 'rgb(171, 171, 171)', + borderTopWidth: StyleSheet.hairlineWidth, + minHeight: 60, + }, + statsContainer: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'flex-start', + }, + summaryText: { + marginStart: 8, + }, +}); diff --git a/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js b/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js index 590d49d40caf33..fbe4696c7bb0c9 100644 --- a/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js +++ b/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js @@ -18,6 +18,8 @@ import type { PlatformTestResultStatus, } from './RNTesterPlatformTestTypes'; +import RNTesterPlatformTestMinimizedResultView from './RNTesterPlatformTestMinimizedResultView'; + import * as React from 'react'; import {useMemo, useState, useCallback} from 'react'; import { @@ -31,6 +33,7 @@ import { TextInput, KeyboardAvoidingView, Platform, + TouchableOpacity, } from 'react-native'; const DISPLAY_STATUS_MAPPING: {[PlatformTestResultStatus]: string} = { @@ -202,62 +205,96 @@ export default function RNTesterPlatformTestResultView( [filteredResults], ); + const [resultsExpanded, setResultsExpanded] = useState(false); + const handleReset = useCallback(() => { setFilterText(''); reset(); + setResultsExpanded(false); }, [reset]); + const handleMinimizedPress = useCallback(() => { + setResultsExpanded(true); + }, []); + + const handleMaximizedPress = useCallback(() => { + setResultsExpanded(false); + }, []); + return ( - - - - Results - {filterText !== '' ? ( - <> - {' '} - - (Filtered: '{filterText}') + <> + + + + + + Results + {filterText !== '' ? ( + + (Filtered: '{filterText}') + + ) : null} + + + {numPass} Pass + + {' '} + + {numFail} Fail + + {' '} + + {numError} Error + + {numPending > 0 ? ( + <> + {' '} + + {numPending}{' '} + Pending + + + ) : null} - - ) : null} - - - - -