@@ -92,6 +92,27 @@ describe('image resolveImage', () => {
9292 expect ( image ?. height ) . toBeGreaterThan ( 0 ) ;
9393 } ) ;
9494
95+ test ( 'Should render a local image from absolute path' , async ( ) => {
96+ const absolutePath = path . join ( __dirname , './assets/test.jpg' ) ;
97+ const image = await resolveImage ( { uri : absolutePath } ) ;
98+
99+ expect ( image ?. data ) . toBeTruthy ( ) ;
100+ expect ( image ?. width ) . toBeGreaterThan ( 0 ) ;
101+ expect ( image ?. height ) . toBeGreaterThan ( 0 ) ;
102+ } ) ;
103+
104+
105+ test ( 'Should render a local image from relative path' , async ( ) => {
106+ const image = await resolveImage ( {
107+ uri : 'packages/layout/tests/assets/test.jpg' ,
108+ } ) ;
109+
110+ expect ( image ?. data ) . toBeTruthy ( ) ;
111+ expect ( image ?. width ) . toBeGreaterThan ( 0 ) ;
112+ expect ( image ?. height ) . toBeGreaterThan ( 0 ) ;
113+ } ) ;
114+
115+
95116 test ( 'Should render a local image from src object' , async ( ) => {
96117 const image = await resolveImage ( {
97118 uri : './packages/layout/tests/assets/test.jpg' ,
@@ -102,6 +123,26 @@ describe('image resolveImage', () => {
102123 expect ( image ?. height ) . toBeGreaterThan ( 0 ) ;
103124 } ) ;
104125
126+ test ( 'Should render a local image with spaces in filename' , async ( ) => {
127+ const image = await resolveImage ( {
128+ uri : './packages/image/tests/assets/test with spaces.jpg' ,
129+ } ) ;
130+
131+ expect ( image ?. data ) . toBeTruthy ( ) ;
132+ expect ( image ?. width ) . toBeGreaterThan ( 0 ) ;
133+ expect ( image ?. height ) . toBeGreaterThan ( 0 ) ;
134+ } ) ;
135+
136+ test ( 'Should render a local image with special characters in filename' , async ( ) => {
137+ const image = await resolveImage ( {
138+ uri : './packages/image/tests/assets/special_ _%20_@&é"\'(§è!çà)-^$ù`,;:=?.+%£¨*<>.jpg' ,
139+ } ) ;
140+
141+ expect ( image ?. data ) . toBeTruthy ( ) ;
142+ expect ( image ?. width ) . toBeGreaterThan ( 0 ) ;
143+ expect ( image ?. height ) . toBeGreaterThan ( 0 ) ;
144+ } ) ;
145+
105146 test ( 'Should render a local image from data' , async ( ) => {
106147 const image = await resolveImage ( { data : localJPGImage , format : 'jpg' } ) ;
107148
0 commit comments