diff --git a/packages/react-native/Libraries/Text/__tests__/Text-itest.js b/packages/react-native/Libraries/Text/__tests__/Text-itest.js index 924a86eb250..e5c96606216 100644 --- a/packages/react-native/Libraries/Text/__tests__/Text-itest.js +++ b/packages/react-native/Libraries/Text/__tests__/Text-itest.js @@ -124,6 +124,47 @@ describe('', () => { }); }); + describe('id and nativeID', () => { + it(`has 'id' propagated correctly`, () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render({TEST_TEXT}); + }); + + expect(root.getRenderedOutput({props: ['nativeID']}).toJSX()).toEqual( + {TEST_TEXT}, + ); + }); + + it(`has 'nativeID' propagated correctly`, () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render({TEST_TEXT}); + }); + + expect(root.getRenderedOutput({props: ['nativeID']}).toJSX()).toEqual( + {TEST_TEXT}, + ); + }); + it(`has a precedence of 'id' over 'nativeID'`, () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render( + + {TEST_TEXT} + , + ); + }); + + expect( + root.getRenderedOutput({props: ['id', 'nativeID']}).toJSX(), + ).toEqual({TEST_TEXT}); + }); + }); + describe('numberOfLines', () => { let originalConsoleError = null;