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 @@ -123,6 +123,44 @@ describe('<Image>', () => {
123123 ) ;
124124 } ) ;
125125 } ) ;
126+
127+ describe ( 'defaultSource' , ( ) => {
128+ it ( 'can provide a default image to display' , ( ) => {
129+ const root = Fantom . createRoot ( ) ;
130+
131+ Fantom . runTask ( ( ) => {
132+ root . render (
133+ < Image
134+ defaultSource = { require ( './img/img1.png' ) }
135+ source = { LOGO_SOURCE }
136+ /> ,
137+ ) ;
138+ } ) ;
139+
140+ expect (
141+ root . getRenderedOutput ( { props : [ 'defaultSource' ] } ) . toJSX ( ) ,
142+ ) . toEqual (
143+ < rn-image
144+ defaultSource-type = "remote"
145+ defaultSource-uri = "file://drawable-mdpi/packages_reactnative_libraries_image___tests___img_img1.png"
146+ /> ,
147+ ) ;
148+ } ) ;
149+ } ) ;
150+
151+ describe ( 'height' , ( ) => {
152+ it ( 'provides height for image' , ( ) => {
153+ const root = Fantom . createRoot ( ) ;
154+
155+ Fantom . runTask ( ( ) => {
156+ root . render ( < Image height = { 100 } source = { LOGO_SOURCE } /> ) ;
157+ } ) ;
158+
159+ expect ( root . getRenderedOutput ( { props : [ 'height' ] } ) . toJSX ( ) ) . toEqual (
160+ < rn-image height = "100.000000" /> ,
161+ ) ;
162+ } ) ;
163+ } ) ;
126164 } ) ;
127165
128166 describe ( 'ref' , ( ) => {
You can’t perform that action at this time.
0 commit comments