@@ -45,7 +45,7 @@ const DetailsScreen = ({ navigation }: StackScreenProps<'Details'>) => {
4545 navigation . setOptions ( {
4646 headerBackVisible : ! x ,
4747 headerRight : ( ) =>
48- x ? < Square size = { 20 } color = "green" /> : < Square size = { 10 } /> ,
48+ x ? < Square size = { 20 } color = "green" testID = "details-green-square" /> : < Square size = { 10 } testID = "details-red-square" /> ,
4949 } ) ;
5050 } , [ navigation , x ] ) ;
5151
@@ -61,13 +61,13 @@ const InfoScreen = ({ navigation }: StackScreenProps<'Info'>) => {
6161
6262 const square1 = ( props : { tintColor ?: string } ) => (
6363 < View style = { { gap : 8 , flexDirection : 'row' } } >
64- { hasLeftItem && < Square { ...props } color = "green" size = { 20 } /> }
65- < Square { ...props } color = "green" size = { 20 } />
64+ { hasLeftItem && < Square { ...props } color = "green" size = { 20 } testID = "info-green-square-2" /> }
65+ < Square { ...props } color = "green" size = { 20 } testID = "info-green-square-1" />
6666 </ View >
6767 ) ;
6868
6969 const square2 = ( props : { tintColor ?: string } ) => (
70- < Square { ...props } color = "red" size = { 20 } />
70+ < Square { ...props } color = "red" size = { 20 } testID = "info-red-square" />
7171 ) ;
7272
7373 useLayoutEffect ( ( ) => {
@@ -95,7 +95,7 @@ const StackNavigator = () => {
9595 name = "Home"
9696 component = { HomeScreen }
9797 options = { {
98- headerRight : ( ) => < Square size = { 20 } color = "black" /> ,
98+ headerRight : ( ) => < Square size = { 20 } color = "black" testID = "home-square" /> ,
9999 } }
100100 />
101101 < Stack . Screen name = "Details" component = { DetailsScreen } />
@@ -112,7 +112,7 @@ const StackNavigator = () => {
112112 options = { {
113113 presentation : 'modal' ,
114114 animation : 'slide_from_bottom' ,
115- headerRight : ( ) => < Square size = { 30 } /> ,
115+ headerRight : ( ) => < Square size = { 30 } testID = "settings-square" /> ,
116116 } }
117117 />
118118 </ Stack . Navigator >
0 commit comments