@@ -149,63 +149,73 @@ describe('<Modal>', () => {
149149 ) ;
150150 } ) ;
151151 } ) ;
152- describe ( 'edgeToEdge ' , ( ) => {
153- it ( 'sets edgeToEdge="true" when both statusBarTranslucent and navigationBarTranslucent are true' , ( ) => {
152+ describe ( 'statusBarTranslucent ' , ( ) => {
153+ it ( 'renders a Modal with statusBarTranslucent=" true" ' , ( ) => {
154154 Fantom . runTask ( ( ) => {
155- root . render (
156- < Modal
157- statusBarTranslucent = { true }
158- navigationBarTranslucent = { true }
159- /> ,
160- ) ;
155+ root . render ( < Modal statusBarTranslucent = { true } /> ) ;
161156 } ) ;
162157
163- expect ( root . getRenderedOutput ( { props : [ 'edgeToEdge' ] } ) . toJSX ( ) ) . toEqual (
164- < rn-modalHostView edgeToEdge = "true" >
158+ expect (
159+ root . getRenderedOutput ( { props : [ 'statusBarTranslucent' ] } ) . toJSX ( ) ,
160+ ) . toEqual (
161+ < rn-modalHostView statusBarTranslucent = "true" >
165162 < rn-view />
166163 </ rn-modalHostView > ,
167164 ) ;
168165 } ) ;
169- it ( 'does not set edgeToEdge when only statusBarTranslucent is true' , ( ) => {
170- // Enabling only one of statusBarTranslucent / navigationBarTranslucent
171- // has no effect and emits a warning.
172- const warn = jest . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } ) ;
173-
166+ it ( 'renders a Modal with statusBarTranslucent="false"' , ( ) => {
174167 Fantom . runTask ( ( ) => {
175- root . render ( < Modal statusBarTranslucent = { true } /> ) ;
168+ root . render ( < Modal statusBarTranslucent = { false } /> ) ;
176169 } ) ;
177170
178- expect ( root . getRenderedOutput ( { props : [ 'edgeToEdge' ] } ) . toJSX ( ) ) . toEqual (
171+ expect (
172+ root . getRenderedOutput ( { props : [ 'statusBarTranslucent' ] } ) . toJSX ( ) ,
173+ ) . toEqual (
179174 < rn-modalHostView >
180175 < rn-view />
181176 </ rn-modalHostView > ,
182177 ) ;
183- expect ( warn ) . toHaveBeenCalled ( ) ;
184- warn . mockRestore ( ) ;
185178 } ) ;
186- it ( 'does not set edgeToEdge when only navigationBarTranslucent is true' , ( ) => {
187- // Enabling only one of statusBarTranslucent / navigationBarTranslucent
188- // has no effect and emits a warning.
189- const warn = jest . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } ) ;
190-
179+ } ) ;
180+ describe ( 'navigationBarTranslucent' , ( ) => {
181+ it ( 'renders a Modal with navigationBarTranslucent="true" and statusBarTranslucent="true"' , ( ) => {
191182 Fantom . runTask ( ( ) => {
192- root . render ( < Modal navigationBarTranslucent = { true } /> ) ;
183+ // navigationBarTranslucent=true with statusBarTranslucent=false is not supported
184+ // and it emits a warning.
185+ root . render (
186+ < Modal
187+ navigationBarTranslucent = { true }
188+ statusBarTranslucent = { true }
189+ /> ,
190+ ) ;
193191 } ) ;
194192
195- expect ( root . getRenderedOutput ( { props : [ 'edgeToEdge' ] } ) . toJSX ( ) ) . toEqual (
196- < rn-modalHostView >
193+ expect (
194+ root
195+ . getRenderedOutput ( {
196+ props : [ 'navigationBarTranslucent' , 'statusBarTranslucent' ] ,
197+ } )
198+ . toJSX ( ) ,
199+ ) . toEqual (
200+ < rn-modalHostView
201+ navigationBarTranslucent = "true"
202+ statusBarTranslucent = "true" >
197203 < rn-view />
198204 </ rn-modalHostView > ,
199205 ) ;
200- expect ( warn ) . toHaveBeenCalled ( ) ;
201- warn . mockRestore ( ) ;
202206 } ) ;
203- it ( 'does not set edgeToEdge when neither is true ' , ( ) => {
207+ it ( 'renders a Modal with navigationBarTranslucent="false" ' , ( ) => {
204208 Fantom . runTask ( ( ) => {
205- root . render ( < Modal /> ) ;
209+ root . render ( < Modal navigationBarTranslucent = { false } /> ) ;
206210 } ) ;
207211
208- expect ( root . getRenderedOutput ( { props : [ 'edgeToEdge' ] } ) . toJSX ( ) ) . toEqual (
212+ expect (
213+ root
214+ . getRenderedOutput ( {
215+ props : [ 'navigationBarTranslucent' , 'statusBarTranslucent' ] ,
216+ } )
217+ . toJSX ( ) ,
218+ ) . toEqual (
209219 < rn-modalHostView >
210220 < rn-view />
211221 </ rn-modalHostView > ,
0 commit comments