Add test for Text.adjustsFontSizeToFit (#53210)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53210

# Changelog:
[Internal] -

As in the title.

Reviewed By: andrewdacenko

Differential Revision: D80001500

fbshipit-source-id: ab5564b0e9ab728f0825aec9da24539c9e2c5290
This commit is contained in:
Ruslan Shestopalyuk authored and Facebook GitHub Bot committed 2025-08-11 08:14:15 -07:00
1 parent 1c33774990
commit 749dbe0840
1 file changed
+28
@@ -47,6 +47,34 @@ describe('<Text>', () => {
});
});
describe('adjustsFontSizeToFit', () => {
it(`can be set to "true"`, () => {
const root = Fantom.createRoot();
Fantom.runTask(() => {
root.render(<Text adjustsFontSizeToFit={true}>{TEST_TEXT}</Text>);
});
expect(
root.getRenderedOutput({props: ['adjustsFontSizeToFit']}).toJSX(),
).toEqual(
<rn-paragraph adjustsFontSizeToFit="true">{TEST_TEXT}</rn-paragraph>,
);
});
it(`has 'false' as default`, () => {
const root = Fantom.createRoot();
Fantom.runTask(() => {
root.render(<Text>{TEST_TEXT}</Text>);
});
expect(
root.getRenderedOutput({props: ['adjustsFontSizeToFit']}).toJSX(),
).toEqual(<rn-paragraph>{TEST_TEXT}</rn-paragraph>);
});
});
describe('allowFontScaling', () => {
([true, false] as const).forEach(propVal => {
it(`can be set to "${propVal.toString()}"`, () => {