mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
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();
|
||||
|
||||
Reference in New Issue
Block a user