-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: converted NativeAnimatedNodeTraversalTest to kotlin #37960
refactor: converted NativeAnimatedNodeTraversalTest to kotlin #37960
Conversation
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Base commit: af57ce1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for working on this one!
Hey @ankit-tailor, it looks like a couple of tests have disappeared during the conversion, namely Was it intentional? Could you please take a look into it? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ankit-tailor Sending back to you, need to understand the fate of disappeared test clauses, see my comment above :)
…tAnimationCallbackFinish
@rshest My bad! Don't know how I missed them. Added them back. |
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accepting as mine are mostly nits. @rshest is going to merge this and we'll need to follow up afterwards
val directEventTypes: Map<String, Map<String, String>>? = | ||
uiManagerMock?.constants?.get("customDirectEventTypes") | ||
as? Map<String, Map<String, String>>? | ||
if (directEventTypes != null) { | ||
val customEventType: Map<String, String>? = | ||
directEventTypes[eventName] as? Map<String, String>? | ||
if (customEventType != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified (i.e. no need to null
check those fields are you're creating them). cc @rshest if you want to integrate this change
} | ||
|
||
fun performSpringAnimationTestWithConfig( | ||
config: JavaOnlyMap?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be non nullable. Plus this function can be private (cc @rshest)
if (i % 3 != 0) { | ||
// i % 3 != 0 because every 3 frames we go a tiny | ||
// bit faster, because frame length is 16.(6)ms | ||
assertThat(currentDiff).`as`("on frame " + i).isLessThanOrEqualTo(previousDiff) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's import as
as describe
or something else 😅
Summary: Follow up to: - #37960 ## Changelog: [INTERNAL] - Update NativeAnimatedNodeTraversalTest to be more idiomatic Pull Request resolved: #37970 Test Plan: Will run on CI Reviewed By: javache, cipolleschi Differential Revision: D46853581 Pulled By: cortinico fbshipit-source-id: 1d324d0d9d24f97bc1ae5c702949615e45837cb8
Summary: Follow up to: - #37960 ## Changelog: [INTERNAL] - Update NativeAnimatedNodeTraversalTest to be more idiomatic Pull Request resolved: #37970 Test Plan: Will run on CI Reviewed By: javache, cipolleschi Differential Revision: D46853581 Pulled By: cortinico fbshipit-source-id: 73776493163413b045482344b7b1be0635f5aa25
Summary:
This PR converts NativeAnimatedNodeTraversalTest into Kotlin as requested in #37708
Changelog:
[INTERNAL] [CHANGED] - Convert
NativeAnimatedNodeTraversalTest
to KotlinTest Plan:
./gradlew :packages:react-native:ReactAndroid:test
.