File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
packages/react-native/Libraries/Image/__tests__ Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,44 @@ describe('<Image>', () => {
169169 ) ;
170170 } ) ;
171171 } ) ;
172+
173+ describe ( 'defaultSource' , ( ) => {
174+ it ( 'can provide a default image to display' , ( ) => {
175+ const root = Fantom . createRoot ( ) ;
176+
177+ Fantom . runTask ( ( ) => {
178+ root . render (
179+ < Image
180+ defaultSource = { require ( './img/img1.png' ) }
181+ source = { LOGO_SOURCE }
182+ /> ,
183+ ) ;
184+ } ) ;
185+
186+ expect (
187+ root . getRenderedOutput ( { props : [ 'defaultSource' ] } ) . toJSX ( ) ,
188+ ) . toEqual (
189+ < rn-image
190+ defaultSource-type = "remote"
191+ defaultSource-uri = "file://drawable-mdpi/packages_reactnative_libraries_image___tests___img_img1.png"
192+ /> ,
193+ ) ;
194+ } ) ;
195+ } ) ;
196+
197+ describe ( 'height' , ( ) => {
198+ it ( 'provides height for image' , ( ) => {
199+ const root = Fantom . createRoot ( ) ;
200+
201+ Fantom . runTask ( ( ) => {
202+ root . render ( < Image height = { 100 } source = { LOGO_SOURCE } /> ) ;
203+ } ) ;
204+
205+ expect ( root . getRenderedOutput ( { props : [ 'height' ] } ) . toJSX ( ) ) . toEqual (
206+ < rn-image height = "100.000000" /> ,
207+ ) ;
208+ } ) ;
209+ } ) ;
172210 } ) ;
173211
174212 describe ( 'ref' , ( ) => {
You can’t perform that action at this time.
0 commit comments