Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ test('moving box by 50 points with offset 10', () => {
// TODO(T232605345): The following line won't be necessary once race condition on Android is fixed.
Fantom.runWorkLoop();
expect(root.getRenderedOutput({props: ['transform']}).toJSX()).toEqual(
<rn-view transform='[{"translateX": 60.000000}]' />,
<rn-view transform='[{"translateX": 60}]' />,
);

expect(finishValue?.finished).toBe(true);
Expand Down Expand Up @@ -579,7 +579,7 @@ test('animate layout props', () => {
}

expect(root.getRenderedOutput({props: ['height']}).toJSX()).toEqual(
<rn-view height="100.000000" />,
<rn-view height="100" />,
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ test('animate layout props', () => {
// TODO: getFabricUpdateProps is not working with the cloneMutliple method
// expect(Fantom.unstable_getFabricUpdateProps(viewElement).height).toBe(100);
expect(root.getRenderedOutput({props: ['height']}).toJSX()).toEqual(
<rn-view height="50.000000" />,
<rn-view height="50" />,
);

Fantom.unstable_produceFramesForDuration(100);
Expand All @@ -128,7 +128,7 @@ test('animate layout props', () => {
});

expect(root.getRenderedOutput({props: ['height']}).toJSX()).toEqual(
<rn-view height="100.000000" />,
<rn-view height="100" />,
);
});

Expand Down Expand Up @@ -174,7 +174,7 @@ test('animate layout props and rerender', () => {

Fantom.unstable_produceFramesForDuration(500);
expect(root.getRenderedOutput({props: ['height', 'width']}).toJSX()).toEqual(
<rn-view height="50.000000" width="100.000000" />,
<rn-view height="50" width="100" />,
);

Fantom.runTask(() => {
Expand All @@ -184,7 +184,7 @@ test('animate layout props and rerender', () => {
// TODO: getFabricUpdateProps is not working with the cloneMutliple method
// expect(Fantom.unstable_getFabricUpdateProps(viewElement).height).toBe(50);
expect(root.getRenderedOutput({props: ['height', 'width']}).toJSX()).toEqual(
<rn-view height="50.000000" width="200.000000" />,
<rn-view height="50" width="200" />,
);

Fantom.unstable_produceFramesForDuration(500);
Expand All @@ -195,15 +195,15 @@ test('animate layout props and rerender', () => {
});

expect(root.getRenderedOutput({props: ['height', 'width']}).toJSX()).toEqual(
<rn-view height="100.000000" width="200.000000" />,
<rn-view height="100" width="200" />,
);

Fantom.runTask(() => {
_setWidth(300);
});

expect(root.getRenderedOutput({props: ['height', 'width']}).toJSX()).toEqual(
<rn-view height="100.000000" width="300.000000" />,
<rn-view height="100" width="300" />,
);
});

Expand Down Expand Up @@ -250,9 +250,9 @@ test('animate non-layout props and rerender', () => {

Fantom.unstable_produceFramesForDuration(500);

// TODO: rendered output should be <rn-view opacity="0,5" width="100.000000" /> at this point, but synchronous updates are not captured by fantom
// TODO: rendered output should be <rn-view opacity="0,5" width="100" /> at this point, but synchronous updates are not captured by fantom
expect(root.getRenderedOutput({props: ['width']}).toJSX()).toEqual(
<rn-view width="100.000000" />,
<rn-view width="100" />,
);

expect(
Expand All @@ -265,7 +265,7 @@ test('animate non-layout props and rerender', () => {
});

expect(root.getRenderedOutput({props: ['opacity', 'width']}).toJSX()).toEqual(
<rn-view opacity="0.25" width="150.000000" />,
<rn-view opacity="0.25" width="150" />,
);

Fantom.runTask(() => {
Expand All @@ -275,7 +275,7 @@ test('animate non-layout props and rerender', () => {
// TODO: getFabricUpdateProps is not working with the cloneMutliple method
// expect(Fantom.unstable_getFabricUpdateProps(viewElement).height).toBe(50);
expect(root.getRenderedOutput({props: ['opacity', 'width']}).toJSX()).toEqual(
<rn-view opacity="0.25" width="200.000000" />,
<rn-view opacity="0.25" width="200" />,
);

Fantom.unstable_produceFramesForDuration(500);
Expand All @@ -287,7 +287,7 @@ test('animate non-layout props and rerender', () => {

// TODO: T246961305 rendered output should be <rn-view opacity="1" /> at this point
expect(root.getRenderedOutput({props: ['width']}).toJSX()).toEqual(
<rn-view width="200.000000" />,
<rn-view width="200" />,
);

expect(Fantom.unstable_getDirectManipulationProps(viewElement).opacity).toBe(
Expand All @@ -300,7 +300,7 @@ test('animate non-layout props and rerender', () => {
});

expect(root.getRenderedOutput({props: ['opacity', 'width']}).toJSX()).toEqual(
<rn-view opacity="0.5" width="300.000000" />,
<rn-view opacity="0.5" width="300" />,
);
});

Expand Down Expand Up @@ -373,9 +373,9 @@ test('animate layout props and rerender in many components', () => {

Fantom.unstable_produceFramesForDuration(500);
expect(root.getRenderedOutput({props: ['height', 'width']}).toJSX()).toEqual(
<rn-view height="50.000000" width="100.000000">
<rn-view height="50" width="100">
{Array.from({length: N}, (_, i) => (
<rn-view key={i} height="50.000000" width="100.000000" />
<rn-view key={i} height="50" width="100" />
))}
</rn-view>,
);
Expand All @@ -392,9 +392,9 @@ test('animate layout props and rerender in many components', () => {
// TODO: getFabricUpdateProps is not working with the cloneMutliple method
// expect(Fantom.unstable_getFabricUpdateProps(viewElement).height).toBe(50);
expect(root.getRenderedOutput({props: ['height', 'width']}).toJSX()).toEqual(
<rn-view height="50.000000" width="200.000000">
<rn-view height="50" width="200">
{Array.from({length: N}, (_, i) => (
<rn-view key={i} height="50.000000" width="100.000000" />
<rn-view key={i} height="50" width="100" />
))}
</rn-view>,
);
Expand Down Expand Up @@ -466,7 +466,7 @@ test('animate width, height and opacity at once', () => {

expect(
root.getRenderedOutput({props: ['width', 'height', 'opacity']}).toJSX(),
).toEqual(<rn-view height="200.000000" opacity="0.5" width="200.000000" />);
).toEqual(<rn-view height="200" opacity="0.5" width="200" />);
});

test('animate width with memo and rerender (js sync test)', () => {
Expand Down Expand Up @@ -532,7 +532,7 @@ test('animate width with memo and rerender (js sync test)', () => {
});

expect(root.getRenderedOutput({props: ['width', 'height']}).toJSX()).toEqual(
<rn-view height="100.000000" width="100.000000" />,
<rn-view height="100" width="100" />,
);

Fantom.unstable_produceFramesForDuration(1000);
Expand All @@ -543,7 +543,7 @@ test('animate width with memo and rerender (js sync test)', () => {
});

expect(root.getRenderedOutput({props: ['width']}).toJSX()).toEqual(
<rn-view width="200.000000" />,
<rn-view width="200" />,
);

// Trigger rerender after animation completes to see if animation state gets overwritten
Expand All @@ -552,6 +552,6 @@ test('animate width with memo and rerender (js sync test)', () => {
});

expect(root.getRenderedOutput({props: ['width']}).toJSX()).toEqual(
<rn-view width="200.000000" />,
<rn-view width="200" />,
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('<ActivityIndicator>', () => {
});

expect(root.getRenderedOutput().toJSX()).toEqual(
<rn-androidProgressBar height="20.000000" width="20.000000" />,
<rn-androidProgressBar height="20" width="20" />,
);
});

Expand All @@ -40,7 +40,7 @@ describe('<ActivityIndicator>', () => {
});

expect(root.getRenderedOutput().toJSX()).toEqual(
<rn-androidProgressBar height="20.000000" width="20.000000" />,
<rn-androidProgressBar height="20" width="20" />,
);
});

Expand All @@ -52,7 +52,7 @@ describe('<ActivityIndicator>', () => {
});

expect(root.getRenderedOutput().toJSX()).toEqual(
<rn-androidProgressBar height="36.000000" width="36.000000" />,
<rn-androidProgressBar height="36" width="36" />,
);
});

Expand All @@ -64,7 +64,7 @@ describe('<ActivityIndicator>', () => {
});

expect(root.getRenderedOutput().toJSX()).toEqual(
<rn-androidProgressBar height="48.000000" width="48.000000" />,
<rn-androidProgressBar height="48" width="48" />,
);
});
});
Expand All @@ -80,7 +80,7 @@ describe('<ActivityIndicator>', () => {
// Color is a native prop not serialized as a view attribute,
// but the component still renders correctly
expect(root.getRenderedOutput().toJSX()).toEqual(
<rn-androidProgressBar height="20.000000" width="20.000000" />,
<rn-androidProgressBar height="20" width="20" />,
);
});
});
Expand All @@ -95,7 +95,7 @@ describe('<ActivityIndicator>', () => {

// Component renders normally when animating (default)
expect(root.getRenderedOutput().toJSX()).toEqual(
<rn-androidProgressBar height="20.000000" width="20.000000" />,
<rn-androidProgressBar height="20" width="20" />,
);
});

Expand All @@ -108,7 +108,7 @@ describe('<ActivityIndicator>', () => {

// Component still renders when not animating
expect(root.getRenderedOutput().toJSX()).toEqual(
<rn-androidProgressBar height="20.000000" width="20.000000" />,
<rn-androidProgressBar height="20" width="20" />,
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ describe('<Pressable>', () => {
accessible="true"
accessibilityState="{disabled:false,selected:false,checked:None,busy:false,expanded:null}"
backgroundColor="rgba(0, 0, 255, 1)"
borderWidth="3.000000"
height="50.000000"
borderWidth="3"
height="50"
opacity="40"
width="100.000000"
width="100"
/>,
);
});
Expand Down Expand Up @@ -148,8 +148,8 @@ describe('<Pressable>', () => {
<rn-paragraph
allowFontScaling="true"
ellipsizeMode="tail"
fontSize="NaN"
fontSizeMultiplier="NaN"
fontSize="nan"
fontSizeMultiplier="nan"
foregroundColor="rgba(0, 0, 0, 0)"
overflow="hidden">
the quick brown fox
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ describe('<TouchableHighlight>', () => {
).toEqual(
<rn-view
backgroundColor="rgba(0, 0, 255, 1)"
height="50.000000"
width="100.000000"
height="50"
width="100"
/>,
);
});
Expand Down Expand Up @@ -130,7 +130,7 @@ describe('<TouchableHighlight>', () => {

expect(root.getRenderedOutput({props: ['opacity']}).toJSX()).toEqual(
<rn-view>
<rn-view opacity="0.8500000238418579" />
<rn-view opacity="0.85" />
</rn-view>,
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ describe('<TouchableOpacity>', () => {
).toEqual(
<rn-view
backgroundColor="rgba(0, 0, 255, 1)"
height="50.000000"
width="100.000000"
height="50"
width="100"
/>,
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ describe('<View>', () => {
).toEqual(
<rn-view
layoutMetrics-frame="{x:0,y:0,width:20,height:50}"
height="50.000000%"
height="50%"
layoutMetrics-borderWidth="{top:0,right:0,bottom:0,left:0}"
layoutMetrics-contentInsets="{top:0,right:0,bottom:0,left:0}"
layoutMetrics-displayType="Flex"
layoutMetrics-layoutDirection="LeftToRight"
layoutMetrics-overflowInset="{top:0,right:-0,bottom:-0,left:0}"
layoutMetrics-pointScaleFactor="3"
width="20.000000%"
width="20%"
/>,
);
});
Expand All @@ -69,14 +69,14 @@ describe('<View>', () => {
).toEqual(
<rn-view
layoutMetrics-frame="{x:0,y:0,width:5,height:10}"
height="10.000000"
height="10"
layoutMetrics-borderWidth="{top:0,right:0,bottom:0,left:0}"
layoutMetrics-contentInsets="{top:0,right:0,bottom:0,left:0}"
layoutMetrics-displayType="Flex"
layoutMetrics-layoutDirection="LeftToRight"
layoutMetrics-overflowInset="{top:0,right:-0,bottom:-0,left:0}"
layoutMetrics-pointScaleFactor="3"
width="5.000000"
width="5"
/>,
);
});
Expand Down Expand Up @@ -134,15 +134,15 @@ describe('<View>', () => {
).toEqual(
<rn-view
layoutMetrics-frame="{x:50,y:50,width:5,height:10}"
height="10.000000"
height="10"
layoutMetrics-borderWidth="{top:0,right:0,bottom:0,left:0}"
layoutMetrics-contentInsets="{top:0,right:0,bottom:0,left:0}"
layoutMetrics-displayType="Flex"
layoutMetrics-layoutDirection="LeftToRight"
layoutMetrics-overflowInset="{top:0,right:-0,bottom:-0,left:0}"
layoutMetrics-pointScaleFactor="3"
margin="50.000000%"
width="5.000000"
margin="50%"
width="5"
/>,
);
});
Expand All @@ -166,15 +166,15 @@ describe('<View>', () => {
).toEqual(
<rn-view
layoutMetrics-frame="{x:5,y:5,width:5,height:10}"
height="10.000000"
height="10"
layoutMetrics-borderWidth="{top:0,right:0,bottom:0,left:0}"
layoutMetrics-contentInsets="{top:0,right:0,bottom:0,left:0}"
layoutMetrics-displayType="Flex"
layoutMetrics-layoutDirection="LeftToRight"
layoutMetrics-overflowInset="{top:0,right:-0,bottom:-0,left:0}"
layoutMetrics-pointScaleFactor="3"
margin="5.000000"
width="5.000000"
margin="5"
width="5"
/>,
);
});
Expand All @@ -190,7 +190,7 @@ describe('<View>', () => {

expect(
root.getRenderedOutput({props: ['transform']}).toJSX(),
).toEqual(<rn-view transform='[{"translateX": 10.000000}]' />);
).toEqual(<rn-view transform='[{"translateX": 10}]' />);
});

[
Expand Down
Loading
Loading