Prop test for Text.allowFontScaling

Summary:
# Changelog:
[Internal] -

Adds Fantom test for `Text.allowFontScaling`.

Reviewed By: andrewdacenko

Differential Revision: D79882955

fbshipit-source-id: b1426c1e7f2667c2db017d749710320ec1e6aadd
This commit is contained in:
Ruslan Shestopalyuk
2025-08-08 06:49:05 -07:00
committed by Facebook GitHub Bot
parent 91f9ff042d
commit 404c975ff2
@@ -46,6 +46,40 @@ describe('<Text>', () => {
});
});
describe('allowFontScaling', () => {
([true, false] as const).forEach(propVal => {
it(`can be set to "${propVal.toString()}"`, () => {
const root = Fantom.createRoot();
Fantom.runTask(() => {
root.render(<Text allowFontScaling={propVal}>{TEST_TEXT}</Text>);
});
expect(
root.getRenderedOutput({props: ['allowFontScaling']}).toJSX(),
).toEqual(
<rn-paragraph allowFontScaling={propVal.toString()}>
{TEST_TEXT}
</rn-paragraph>,
);
});
});
it(`has 'true' as default`, () => {
const root = Fantom.createRoot();
Fantom.runTask(() => {
root.render(<Text>{TEST_TEXT}</Text>);
});
expect(
root.getRenderedOutput({props: ['allowFontScaling']}).toJSX(),
).toEqual(
<rn-paragraph allowFontScaling={'true'}>{TEST_TEXT}</rn-paragraph>,
);
});
});
describe('ellipsizeMode', () => {
it(`has 'tail' as default on JS side`, () => {
const root = Fantom.createRoot();