File tree Expand file tree Collapse file tree
component-integration-tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { enableFreeze } from 'react-native-screens' ;
3+
34import Example from './Example' ;
4- // import * as Test from './src/tests/issue-tests';
5+ // import { NavigationContainer } from '@react-navigation/native';
6+ // import { Tests } from './src/tests';
57
68enableFreeze ( true ) ;
79
810export default function App ( ) {
911 return < Example /> ;
10- // return <Test.TestBottomTabs />;
12+ // return (
13+ // <NavigationContainer>
14+ // <Tests.Issue.TestBottomTabs />
15+ // </NavigationContainer>
16+ // );
1117}
Original file line number Diff line number Diff line change @@ -5,14 +5,13 @@ import {
55 NavigationIndependentTree ,
66} from '@react-navigation/native' ;
77import { createNativeStackNavigator } from '@react-navigation/native-stack' ;
8- import { ScenarioGroup } from '../shared/helpers' ;
98import { ScenarioButton } from '../shared/ScenarioButton' ;
109
1110import OrientationScenarioGroup from './orientation' ;
1211import ScrollViewScenarioGroup from './scroll-view' ;
1312import ScenarioSelectionScreen from '../shared/ScenarioScreen' ;
1413
15- const COMPONENT_SCENARIOS : Record < string , ScenarioGroup > = {
14+ export const COMPONENT_SCENARIOS = {
1615 Orientation : OrientationScenarioGroup ,
1716 ScrollView : ScrollViewScenarioGroup ,
1817} as const ;
Original file line number Diff line number Diff line change @@ -2,11 +2,13 @@ import { ScenarioGroup } from '../../shared/helpers';
22import StackInTabs from './orientation-stack-in-tabs' ;
33import TabsInStack from './orientation-tabs-in-stack' ;
44
5- const OrientationScenarios : ScenarioGroup = {
5+ const scenarios = { StackInTabs, TabsInStack } ;
6+
7+ const OrientationScenarioGroup : ScenarioGroup < keyof typeof scenarios > = {
68 name : 'Orientation tests' ,
79 details :
810 'Test interaction between different components when orientation changes' ,
9- scenarios : [ StackInTabs , TabsInStack ] ,
11+ scenarios,
1012} ;
1113
12- export default OrientationScenarios ;
14+ export default OrientationScenarioGroup ;
Original file line number Diff line number Diff line change 11import { ScenarioGroup } from '../../shared/helpers' ;
22
3- const ScrollViewScenarioGroup : ScenarioGroup = {
3+ const scenarios = { } ;
4+
5+ const ScrollViewScenarioGroup : ScenarioGroup < keyof typeof scenarios > = {
46 name : 'ScrollView integration tests' ,
57 details : 'Tests related to integration of our components with ScrollView' ,
6- scenarios : [ ] ,
8+ scenarios,
79} ;
810
911export default ScrollViewScenarioGroup ;
Original file line number Diff line number Diff line change 1+ import { COMPONENT_SCENARIOS as Feature } from './single-feature-tests' ;
2+ import { COMPONENT_SCENARIOS as Integration } from './component-integration-tests' ;
3+ import * as Issue from './issue-tests' ;
4+
5+ export const Tests = {
6+ Feature,
7+ Integration,
8+ Issue,
9+ } ;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export interface Scenario {
2828 AppComponent : React . ComponentType ;
2929}
3030
31- export interface ScenarioGroup {
31+ export interface ScenarioGroup < K extends string > {
3232 /**
3333 * Name of this scenario group
3434 */
@@ -37,7 +37,7 @@ export interface ScenarioGroup {
3737 * Additional description of what this group of scenarios is related to.
3838 */
3939 details ?: string ;
40- scenarios : Scenario [ ] ;
40+ scenarios : Record < K , Scenario > ;
4141}
4242
4343export type KeyList = Record < keyof any , undefined > ;
Original file line number Diff line number Diff line change @@ -10,11 +10,10 @@ import TabsScenarioGroup from './tabs';
1010import SplitScenarioGroup from './split' ;
1111import StackV5ScenarioGroup from './stack-v5' ;
1212import StackV4ScenarioGroup from './stack-v4' ;
13- import type { ScenarioGroup } from '../shared/helpers' ;
1413import { ScenarioButton } from '../shared/ScenarioButton' ;
1514import ScenarioSelectionScreen from '../shared/ScenarioScreen' ;
1615
17- export const COMPONENT_SCENARIOS : Record < string , ScenarioGroup > = {
16+ export const COMPONENT_SCENARIOS = {
1817 Tabs : TabsScenarioGroup ,
1918 Split : SplitScenarioGroup ,
2019 StackV5 : StackV5ScenarioGroup ,
Original file line number Diff line number Diff line change @@ -2,10 +2,12 @@ import { ScenarioGroup } from '../../shared/helpers';
22import TestTopColumnForCollapsing from './test-top-column-for-collapsing' ;
33import TestCommandShowColumn from './test-command-show-column' ;
44
5- const SplitScenarioGroup : ScenarioGroup = {
5+ const scenarios = { TestTopColumnForCollapsing, TestCommandShowColumn } ;
6+
7+ const SplitScenarioGroup : ScenarioGroup < keyof typeof scenarios > = {
68 name : 'Split' ,
79 details : 'Single feature tests for Split' ,
8- scenarios : [ TestTopColumnForCollapsing , TestCommandShowColumn ] ,
10+ scenarios,
911} ;
1012
1113export default SplitScenarioGroup ;
Original file line number Diff line number Diff line change 11import type { ScenarioGroup } from '../../shared/helpers' ;
22import Orientation from './stack-v4-orientation' ;
33
4- const StackV4ScenarioGroup : ScenarioGroup = {
4+ const scenarios = { Orientation } ;
5+
6+ const StackV4ScenarioGroup : ScenarioGroup < keyof typeof scenarios > = {
57 name : 'Stack v4' ,
68 details : 'Single feature tests for Stack v4' ,
7- scenarios : [ Orientation ] ,
9+ scenarios,
810} ;
911
1012export default StackV4ScenarioGroup ;
Original file line number Diff line number Diff line change @@ -3,14 +3,16 @@ import PreventNativeDismissSingleStack from './prevent-native-dismiss-single-sta
33import PreventNativeDismissNestedStack from './prevent-native-dismiss-nested-stack' ;
44import AnimationAndroid from './test-animation-android' ;
55
6- const StackScenarioGroup : ScenarioGroup = {
6+ const scenarios = {
7+ PreventNativeDismissSingleStack,
8+ PreventNativeDismissNestedStack,
9+ AnimationAndroid,
10+ } ;
11+
12+ const StackScenarioGroup : ScenarioGroup < keyof typeof scenarios > = {
713 name : 'Stack v5' ,
814 details : 'Single feature tests for new stack implementation' ,
9- scenarios : [
10- PreventNativeDismissSingleStack ,
11- PreventNativeDismissNestedStack ,
12- AnimationAndroid ,
13- ] ,
15+ scenarios,
1416} ;
1517
1618export default StackScenarioGroup ;
You can’t perform that action at this time.
0 commit comments