From 404c975ff21750d1f666d138a70ea9725bc75789 Mon Sep 17 00:00:00 2001 From: Ruslan Shestopalyuk Date: Fri, 8 Aug 2025 06:49:05 -0700 Subject: [PATCH] Prop test for Text.allowFontScaling Summary: # Changelog: [Internal] - Adds Fantom test for `Text.allowFontScaling`. Reviewed By: andrewdacenko Differential Revision: D79882955 fbshipit-source-id: b1426c1e7f2667c2db017d749710320ec1e6aadd --- .../Libraries/Text/__tests__/Text-itest.js | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/packages/react-native/Libraries/Text/__tests__/Text-itest.js b/packages/react-native/Libraries/Text/__tests__/Text-itest.js index e5d46240c74..f614c2340ec 100644 --- a/packages/react-native/Libraries/Text/__tests__/Text-itest.js +++ b/packages/react-native/Libraries/Text/__tests__/Text-itest.js @@ -46,6 +46,40 @@ describe('', () => { }); }); + describe('allowFontScaling', () => { + ([true, false] as const).forEach(propVal => { + it(`can be set to "${propVal.toString()}"`, () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render({TEST_TEXT}); + }); + + expect( + root.getRenderedOutput({props: ['allowFontScaling']}).toJSX(), + ).toEqual( + + {TEST_TEXT} + , + ); + }); + }); + + it(`has 'true' as default`, () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render({TEST_TEXT}); + }); + + expect( + root.getRenderedOutput({props: ['allowFontScaling']}).toJSX(), + ).toEqual( + {TEST_TEXT}, + ); + }); + }); + describe('ellipsizeMode', () => { it(`has 'tail' as default on JS side`, () => { const root = Fantom.createRoot();