Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit d084447

Browse files
committed
Basic integration test on componentWillReceiveProps.
1 parent 1539dd6 commit d084447

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

tests/CacheableImage.test.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,6 @@ describe('CacheableImage', function() {
298298

299299
it('#_loadImage should warn developer on error getting local file path.', () => {
300300

301-
// Verify source uri prop only accepts web accessible urls.
302-
303301
const CacheableImage = imageCacheHoc(Image);
304302

305303
const imageUrl = 'https://img.wennermedia.com/5333a62d-07db-432a-92e2-198cafa38a14-326adb1a-d8ed-4a5d-b37e-5c88883e1989.png';
@@ -330,6 +328,24 @@ describe('CacheableImage', function() {
330328

331329
});
332330

331+
it('componentWillReceiveProps should not throw any uncaught errors.', () => {
332+
333+
const CacheableImage = imageCacheHoc(Image);
334+
335+
const cacheableImage = new CacheableImage({ // eslint-disable-line no-unused-vars
336+
source: {
337+
uri: 'https://img.wennermedia.com/5333a62d-07db-432a-92e2-198cafa38a14-326adb1a-d8ed-4a5d-b37e-5c88883e1989.png'
338+
}
339+
});
340+
341+
cacheableImage.componentWillReceiveProps({ // eslint-disable-line no-unused-vars
342+
source: {
343+
uri: 'https://img.wennermedia.com/wallpaper1-39bd413b-cb85-4af0-9f33-3507f272e562.jpg'
344+
}
345+
});
346+
347+
});
348+
333349
it('#render with valid props does not throw an error.', () => {
334350

335351
const CacheableImage = imageCacheHoc(Image);

0 commit comments

Comments
 (0)