Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

Commit 32453dc

Browse files
committed
✅ (transitions) fix tests
1 parent 80b637a commit 32453dc

6 files changed

Lines changed: 125 additions & 0 deletions

File tree

src/transitions/CardSkewUp.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export class CardSkewUp extends TransitionComponent {
7575
clock = new Clock();
7676
progress: Animated.Value<number> = new Value(this.props.directionForward ? 0 : 1);
7777
animation: Animated.Value<number> = new Value(this.props.directionForward ? 0 : 1);
78+
// istanbul ignore next
7879
trans = runTiming(this.clock, this.progress, this.animation, () => {
7980
// react-native-reanimated is not correctly mocked
8081
// istanbul ignore next

src/transitions/RotateCrazy.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export class RotateCrazy extends TransitionComponent {
7373
clock = new Clock();
7474
progress: Animated.Value<number> = new Value(this.props.directionForward ? 0 : 1);
7575
animation: Animated.Value<number> = new Value(this.props.directionForward ? 0 : 1);
76+
// istanbul ignore next
7677
trans = runTiming(this.clock, this.progress, this.animation, () => {
7778
// react-native-reanimated is not correctly mocked
7879
// istanbul ignore next

src/transitions/SlideLeft.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ export class SlideLeft extends TransitionComponent {
7373
clock = new Clock();
7474
progress: Animated.Value<number> = new Value(this.props.directionForward ? 0 : 1);
7575
animation: Animated.Value<number> = new Value(this.props.directionForward ? 0 : 1);
76+
77+
// istanbul ignore next
7678
transX = runTiming(this.clock, this.progress, this.animation, () => {
7779
// react-native-reanimated is not correctly mocked
7880
// istanbul ignore next

src/transitions/SlideUp.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export class SlideUp extends TransitionComponent {
7474
clock = new Clock();
7575
progress: Animated.Value<number> = new Value(this.props.directionForward ? 0 : 1);
7676
animation: Animated.Value<number> = new Value(this.props.directionForward ? 0 : 1);
77+
78+
// istanbul ignore next
7779
transY = runTiming(this.clock, this.progress, this.animation, () => {
7880
// react-native-reanimated is not correctly mocked
7981
// istanbul ignore next
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`hides its child if direction is backward 1`] = `
4+
<View
5+
collapsable={false}
6+
pointerEvents="none"
7+
style={
8+
Object {
9+
"alignItems": "center",
10+
"backgroundColor": "#00000050",
11+
"bottom": 0,
12+
"justifyContent": "center",
13+
"left": 0,
14+
"position": "absolute",
15+
"right": 0,
16+
"top": 0,
17+
}
18+
}
19+
>
20+
<View
21+
collapsable={false}
22+
style={Object {}}
23+
/>
24+
</View>
25+
`;
26+
27+
exports[`shows its child if direction changed to forward 1`] = `
28+
<View
29+
collapsable={false}
30+
pointerEvents="auto"
31+
style={
32+
Object {
33+
"alignItems": "center",
34+
"backgroundColor": "#00000050",
35+
"bottom": 0,
36+
"justifyContent": "center",
37+
"left": 0,
38+
"position": "absolute",
39+
"right": 0,
40+
"top": 0,
41+
}
42+
}
43+
>
44+
<View
45+
collapsable={false}
46+
style={Object {}}
47+
>
48+
<Text
49+
testID="child"
50+
>
51+
I should be rendered
52+
</Text>
53+
</View>
54+
</View>
55+
`;
56+
57+
exports[`shows its child if direction is forward 1`] = `
58+
<View
59+
collapsable={false}
60+
pointerEvents="auto"
61+
style={
62+
Object {
63+
"alignItems": "center",
64+
"backgroundColor": "#00000050",
65+
"bottom": 0,
66+
"justifyContent": "center",
67+
"left": 0,
68+
"position": "absolute",
69+
"right": 0,
70+
"top": 0,
71+
}
72+
}
73+
>
74+
<View
75+
collapsable={false}
76+
style={Object {}}
77+
>
78+
<Text
79+
testID="child"
80+
>
81+
I should be rendered
82+
</Text>
83+
</View>
84+
</View>
85+
`;
86+
87+
exports[`snapshots component when direction changed to backward 1`] = `
88+
<View
89+
collapsable={false}
90+
pointerEvents="auto"
91+
style={
92+
Object {
93+
"alignItems": "center",
94+
"backgroundColor": "#00000050",
95+
"bottom": 0,
96+
"justifyContent": "center",
97+
"left": 0,
98+
"position": "absolute",
99+
"right": 0,
100+
"top": 0,
101+
}
102+
}
103+
>
104+
<View
105+
collapsable={false}
106+
style={Object {}}
107+
>
108+
<Text
109+
testID="child"
110+
>
111+
I should not be rendered
112+
</Text>
113+
</View>
114+
</View>
115+
`;

src/transitions/__tests__/__snapshots__/RotateCrazy.test.tsx.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
exports[`hides its child if direction is backward 1`] = `
44
<View
55
collapsable={false}
6+
pointerEvents="none"
67
style={
78
Object {
89
"bottom": 0,
@@ -18,6 +19,7 @@ exports[`hides its child if direction is backward 1`] = `
1819
exports[`shows its child if direction changed to forward 1`] = `
1920
<View
2021
collapsable={false}
22+
pointerEvents="auto"
2123
style={
2224
Object {
2325
"bottom": 0,
@@ -39,6 +41,7 @@ exports[`shows its child if direction changed to forward 1`] = `
3941
exports[`shows its child if direction is forward 1`] = `
4042
<View
4143
collapsable={false}
44+
pointerEvents="auto"
4245
style={
4346
Object {
4447
"bottom": 0,
@@ -60,6 +63,7 @@ exports[`shows its child if direction is forward 1`] = `
6063
exports[`snapshots component when direction changed to backward 1`] = `
6164
<View
6265
collapsable={false}
66+
pointerEvents="auto"
6367
style={
6468
Object {
6569
"bottom": 0,

0 commit comments

Comments
 (0)