Skip to content

Commit 4be170f

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Test inline views at reduced font scale (#57913)
Summary: Add an RNTester example for inline views and a Jest E2E screenshot test that runs Android with `fontScale=0.85`. Thread the optional font-scale setting through `ReactNativeCoreE2ESetup` so the test can use the RNTester adapter support from the prerequisite framework diff. Reviewed By: christophpurrer Differential Revision: D115583513
1 parent 551d12a commit 4be170f

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

packages/rn-tester/js/components/TextInlineView.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ function Basic(): React.Node {
2626
);
2727
}
2828

29+
function FontScale(): React.Node {
30+
return (
31+
<RNTesterText testID="inline-view-font-scale">
32+
This text contains an inline view{' '}
33+
<View style={{width: 80, height: 40, backgroundColor: 'steelblue'}} />
34+
</RNTesterText>
35+
);
36+
}
37+
2938
function NestedTexts(): React.Node {
3039
return (
3140
<View>
@@ -201,6 +210,7 @@ function ChangeInnerViewSize(): React.Node {
201210

202211
module.exports = {
203212
Basic,
213+
FontScale,
204214
NestedTexts,
205215
ClippedByText,
206216
ChangeImageSize,

packages/rn-tester/js/examples/Text/TextExample.android.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,13 @@ const examples = [
16551655
return <TextInlineView.Basic />;
16561656
},
16571657
},
1658+
{
1659+
title: 'Inline view with a reduced font scale',
1660+
name: 'inlineViewFontScale',
1661+
render(): React.Node {
1662+
return <TextInlineView.FontScale />;
1663+
},
1664+
},
16581665
{
16591666
title: 'Inline views with multiple nested texts',
16601667
name: 'inlineViewsMultiple',

0 commit comments

Comments
 (0)