Skip to content

Commit

Permalink
Add E2E Test for experimental_layoutConformance (facebook#42002)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#42002

Adds an E2E test on top of the RNTester example for this (as a practice we should probably do this for new examples).

I didn't add unit tests for this originally, but probably should do that as well if it gets more interesting...

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D51639134

fbshipit-source-id: 379d95dfc676252e10b7076e294ac5534c6f06bf
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Dec 19, 2023
1 parent bd4ddbe commit 11d3e11
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/rn-tester/js/examples/View/ViewExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,11 @@ class FlexGapExample extends React.Component<$ReadOnly<{|testID?: ?string|}>> {
}
}

function LayoutConformanceExample(): React.Node {
function LayoutConformanceExample({
testID,
}: $ReadOnly<{testID: ?string}>): React.Node {
return (
<View style={{flexDirection: 'row', gap: 10}}>
<View style={{flexDirection: 'row', gap: 10}} testID={testID}>
<View>
<Text>Unset</Text>
<LayoutConformanceBox />
Expand All @@ -367,8 +369,8 @@ function LayoutConformanceBox(): React.Node {
<View
style={{
backgroundColor: 'blue',
width: 100,
height: 100,
width: 60,
height: 60,
flexDirection: 'row',
alignItems: 'center',
}}>
Expand All @@ -378,7 +380,7 @@ function LayoutConformanceBox(): React.Node {
}}>
<View
style={{
height: 50,
height: 30,
backgroundColor: 'red',
flexGrow: 1,
}}
Expand Down

0 comments on commit 11d3e11

Please sign in to comment.