diff --git a/packages/react-native/Libraries/Image/__tests__/Image-itest.js b/packages/react-native/Libraries/Image/__tests__/Image-itest.js index 98466bd85f8..33ac94c9456 100644 --- a/packages/react-native/Libraries/Image/__tests__/Image-itest.js +++ b/packages/react-native/Libraries/Image/__tests__/Image-itest.js @@ -620,6 +620,34 @@ describe('', () => { }); }); + describe('alt', () => { + it('is passed as accessibilityLabel and marks the image accessible', () => { + const root = Fantom.createRoot(); + Fantom.runTask(() => { + root.render(a picture); + }); + expect( + root + .getRenderedOutput({props: ['accessibilityLabel', 'accessible']}) + .toJSX(), + ).toEqual( + , + ); + }); + }); + + describe('aria-label', () => { + it('is passed as accessibilityLabel', () => { + const root = Fantom.createRoot(); + Fantom.runTask(() => { + root.render(); + }); + expect( + root.getRenderedOutput({props: ['accessibilityLabel']}).toJSX(), + ).toEqual(); + }); + }); + component TestComponent(testID?: ?string, ...props: AccessibilityProps) { return ; } @@ -1047,6 +1075,24 @@ describe('', () => { }); }); + describe('prefetchWithMetadata', () => { + it('prefetches the image', () => { + const uri = 'https://reactnative.dev/img/tiny_logo.png'; + + NativeFantom.setImageResponse(uri, { + width: 100, + height: 100, + }); + + let result; + Fantom.runTask(async () => { + result = await Image.prefetchWithMetadata(uri, 'queryRootName'); + }); + + expect(result).toEqual(true); + }); + }); + describe('queryCache', () => { it('returns empty when image is not cached', () => { const uri = 'https://reactnative.dev/img/tiny_logo.png';