Skip to content

Commit b45837a

Browse files
chore: Add Platform.OS check to AnimatedStyle
1 parent 986a0c2 commit b45837a

File tree

5 files changed

+626
-138
lines changed

5 files changed

+626
-138
lines changed

Libraries/Animated/__tests__/Animated-test.js

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,6 @@ describe('Animated tests', () => {
6565
style: [
6666
{
6767
backgroundColor: 'red',
68-
opacity: anim,
69-
shadowOffset: {
70-
width: anim,
71-
height: anim,
72-
},
73-
transform: [
74-
{translate: [translateAnim, translateAnim]},
75-
{translateX: translateAnim},
76-
{scale: anim},
77-
],
78-
},
79-
{
8068
opacity: 0,
8169
transform: [{translate: [100, 100]}, {translateX: 100}, {scale: 0}],
8270
shadowOffset: {
@@ -101,18 +89,6 @@ describe('Animated tests', () => {
10189
style: [
10290
{
10391
backgroundColor: 'red',
104-
opacity: anim,
105-
shadowOffset: {
106-
width: anim,
107-
height: anim,
108-
},
109-
transform: [
110-
{translate: [translateAnim, translateAnim]},
111-
{translateX: translateAnim},
112-
{scale: anim},
113-
],
114-
},
115-
{
11692
opacity: 0.5,
11793
transform: [
11894
{translate: [150, 150]},
@@ -205,15 +181,15 @@ describe('Animated tests', () => {
205181
<Animated.View style={{opacity}} />,
206182
);
207183

208-
expect(testRenderer.toJSON().props.style[1].opacity).toEqual(0);
184+
expect(testRenderer.toJSON().props.style[0].opacity).toEqual(0);
209185

210186
Animated.timing(opacity, {
211187
toValue: 1,
212188
duration: 0,
213189
useNativeDriver: false,
214190
}).start();
215191

216-
expect(testRenderer.toJSON().props.style[1].opacity).toEqual(1);
192+
expect(testRenderer.toJSON().props.style[0].opacity).toEqual(1);
217193
});
218194

219195
it('warns if `useNativeDriver` is missing', () => {
@@ -857,12 +833,6 @@ describe('Animated tests', () => {
857833

858834
expect(node.__getValue()).toEqual({
859835
style: [
860-
{
861-
top: vecLayout.top,
862-
left: vecLayout.left,
863-
opacity,
864-
transform: vec.getTranslateTransform(),
865-
},
866836
{
867837
opacity: 0.2,
868838
transform: [{translateX: 0}, {translateY: 0}],
@@ -882,12 +852,6 @@ describe('Animated tests', () => {
882852

883853
expect(node.__getValue()).toEqual({
884854
style: [
885-
{
886-
top: vecLayout.top,
887-
left: vecLayout.left,
888-
opacity,
889-
transform: vec.getTranslateTransform(),
890-
},
891855
{
892856
opacity: 0.8,
893857
transform: [{translateX: 42}, {translateY: 1492}],
@@ -988,13 +952,6 @@ describe('Animated tests', () => {
988952
expect(listener).toBeCalledWith({value: 137});
989953
expect(view.__getValue()).toEqual({
990954
style: [
991-
{
992-
transform: [
993-
{
994-
translateX: value4,
995-
},
996-
],
997-
},
998955
{
999956
transform: [
1000957
{
@@ -1091,10 +1048,6 @@ describe('Animated tests', () => {
10911048

10921049
expect(node.__getValue()).toEqual({
10931050
style: [
1094-
{
1095-
backgroundColor: color,
1096-
transform: [{scale}],
1097-
},
10981051
{
10991052
backgroundColor: 'rgba(255, 0, 0, 1)',
11001053
transform: [{scale: 2}],
@@ -1109,10 +1062,6 @@ describe('Animated tests', () => {
11091062
expect(callback.mock.calls.length).toBe(4);
11101063
expect(node.__getValue()).toEqual({
11111064
style: [
1112-
{
1113-
backgroundColor: color,
1114-
transform: [{scale}],
1115-
},
11161065
{
11171066
backgroundColor: 'rgba(11, 22, 33, 0.5)',
11181067
transform: [{scale: 1.5}],

0 commit comments

Comments
 (0)