Skip to content

Commit 16287bf

Browse files
astreetfacebook-github-bot
authored andcommitted
Fix flaky animation tests due to different @config
Reviewed By: adityasharat Differential Revision: D43777827 fbshipit-source-id: 9b90819a08215528eb8c90b39cc487bb51c1fdb6
1 parent aeb07ba commit 16287bf

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

litho-it/src/test/java/com/facebook/litho/animation/AnimationTest.kt

+4-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import android.app.Activity
2121
import android.content.Context
2222
import android.content.Intent
2323
import android.graphics.Color
24-
import android.os.Build
2524
import android.view.View
2625
import android.view.animation.AccelerateInterpolator
2726
import android.widget.FrameLayout
@@ -76,7 +75,6 @@ import org.junit.Test
7675
import org.junit.runner.RunWith
7776
import org.robolectric.Robolectric
7877
import org.robolectric.android.controller.ActivityController
79-
import org.robolectric.annotation.Config
8078
import org.robolectric.annotation.LooperMode
8179

8280
/**
@@ -102,7 +100,6 @@ import org.robolectric.annotation.LooperMode
102100
*/
103101
@LooperMode(LooperMode.Mode.LEGACY)
104102
@SuppressLint("ColorConstantUsageIssue")
105-
@Config(sdk = [Build.VERSION_CODES.KITKAT])
106103
@RunWith(LithoTestRunner::class)
107104
class AnimationTest {
108105
@JvmField @Rule val lithoViewRule = LithoViewRule()
@@ -1095,18 +1092,18 @@ class AnimationTest {
10951092
.isEqualTo(320)
10961093
Assertions.assertThat(lithoView.height)
10971094
.describedAs("view Height should be at start position")
1098-
.isEqualTo(422)
1095+
.isEqualTo(414)
10991096
stateCaller.update()
11001097
lithoViewRule.idle()
11011098

11021099
// X after state update should be at 0 because is going to be animated.
11031100
Assertions.assertThat(lithoView.x).describedAs("view X axis after toggle").isEqualTo(0f)
11041101
// Y after state update should be at 0 because is going to be animated.
11051102
Assertions.assertThat(lithoView.y).describedAs("view Y axis after toggle").isEqualTo(0f)
1106-
// Width after state update should be at 320 because is going to be animated.
1103+
// Width after state update should be same as original because is going to be animated.
11071104
Assertions.assertThat(lithoView.width).describedAs("view Width after toggle").isEqualTo(320)
1108-
// Height after state update should be at 422 because is going to be animated.
1109-
Assertions.assertThat(lithoView.height).describedAs("view Height after toggle").isEqualTo(422)
1105+
// Height after state update should be same as original because is going to be animated.
1106+
Assertions.assertThat(lithoView.height).describedAs("view Height after toggle").isEqualTo(414)
11101107
transitionTestRule.step(5)
11111108

11121109
// Check kdoc for how we calculate this value.

0 commit comments

Comments
 (0)