File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,6 +112,56 @@ describe('render options', () => {
112112} ) ;
113113
114114describe ( 'hidden instance props' , ( ) => {
115+ test ( 'renders Activity hidden and then visible' , async ( ) => {
116+ await render (
117+ < React . Activity mode = "hidden" >
118+ < View testID = "activity-target" >
119+ < Text > Ready</ Text >
120+ </ View >
121+ </ React . Activity > ,
122+ ) ;
123+
124+ expect ( screen . queryByTestId ( 'activity-target' ) ) . not . toBeOnTheScreen ( ) ;
125+ expect ( screen . getByTestId ( 'activity-target' , { includeHiddenElements : true } ) . props . style ) . toEqual (
126+ {
127+ display : 'none' ,
128+ } ,
129+ ) ;
130+ expect ( screen . toJSON ( ) ) . toMatchInlineSnapshot ( `
131+ <View
132+ style={
133+ {
134+ "display": "none",
135+ }
136+ }
137+ testID="activity-target"
138+ >
139+ <Text>
140+ Ready
141+ </Text>
142+ </View>
143+ ` ) ;
144+
145+ await screen . rerender (
146+ < React . Activity mode = "visible" >
147+ < View testID = "activity-target" >
148+ < Text > Ready</ Text >
149+ </ View >
150+ </ React . Activity > ,
151+ ) ;
152+
153+ expect ( screen . getByTestId ( 'activity-target' ) ) . toBeOnTheScreen ( ) ;
154+ expect ( screen . toJSON ( ) ) . toMatchInlineSnapshot ( `
155+ <View
156+ testID="activity-target"
157+ >
158+ <Text>
159+ Ready
160+ </Text>
161+ </View>
162+ ` ) ;
163+ } ) ;
164+
115165 test ( 'does not retain hidden UI when the component suspends on initial render' , async ( ) => {
116166 const promise = new Promise < unknown > ( ( ) => { } ) ;
117167
You can’t perform that action at this time.
0 commit comments