diff --git a/packages/react-native/Libraries/Animated/__tests__/Animated-itest.js b/packages/react-native/Libraries/Animated/__tests__/Animated-itest.js
index 2093ab8a0a0..c91e7bbc818 100644
--- a/packages/react-native/Libraries/Animated/__tests__/Animated-itest.js
+++ b/packages/react-native/Libraries/Animated/__tests__/Animated-itest.js
@@ -77,11 +77,10 @@ test('moving box by 100 points', () => {
// Animation is completed now. C++ Animated will commit the final position to the shadow tree.
if (ReactNativeFeatureFlags.cxxNativeAnimatedRemoveJsSync()) {
- // TODO(T223344928,T232605345): this shouldn't be neccessary once we disable JS sync and Android's race condition.
+ // TODO(T232605345): this shouldn't be neccessary once we fix Android's race condition.
Fantom.runWorkLoop();
expect(viewElement.getBoundingClientRect().x).toBe(100);
} else {
- expect(viewElement.getBoundingClientRect().x).toBe(0);
Fantom.runWorkLoop(); // Animated still schedules a React state update for synchronisation to shadow tree
expect(viewElement.getBoundingClientRect().x).toBe(100);
}
@@ -341,19 +340,16 @@ test('moving box by 50 points with offset 10', () => {
expect(root.getRenderedOutput({props: ['transform']}).toJSX()).toEqual(
,
);
- // TODO(T223344928): this shouldn't be neccessary
- Fantom.runWorkLoop();
} else {
expect(root.getRenderedOutput({props: ['transform']}).toJSX()).toEqual(
,
);
Fantom.runWorkLoop(); // Animated still schedules a React state update for synchronisation to shadow tree
+ expect(root.getRenderedOutput({props: ['transform']}).toJSX()).toEqual(
+ , // // must include offset.
+ );
}
- expect(root.getRenderedOutput({props: ['transform']}).toJSX()).toEqual(
- , // // must include offset.
- );
-
expect(finishValue?.finished).toBe(true);
expect(finishValue?.value).toBe(50); // must not include offset.
expect(finishValue?.offset).toBe(10);
@@ -440,9 +436,6 @@ describe('Value.flattenOffset', () => {
Fantom.unstable_getDirectManipulationProps(viewElement).transform[0];
expect(transform.translateY).toBeCloseTo(40, 0.001);
-
- // TODO(T223344928): this shouldn't be neccessary with cxxNativeAnimatedRemoveJsSync:true
- Fantom.runWorkLoop();
});
});
@@ -539,9 +532,6 @@ describe('Value.extractOffset', () => {
// `extractOffset` resets value back to 0.
// Previously we set offset to 35. The final value is 35.
expect(transform.translateY).toBeCloseTo(35, 0.001);
-
- // TODO(T223344928): this shouldn't be neccessary with cxxNativeAnimatedRemoveJsSync:true
- Fantom.runWorkLoop();
});
});
@@ -739,16 +729,21 @@ test('Animated.sequence', () => {
expect(_isSequenceFinished).toBe(false);
- expect(element.getBoundingClientRect().y).toBe(-16);
-
expect(
// $FlowFixMe[incompatible-use]
Fantom.unstable_getDirectManipulationProps(element).transform[0].translateY,
).toBeCloseTo(0, 0.001);
- Fantom.runWorkLoop(); // React update to sync end state of 2nd timing animation in sequence
-
- expect(element.getBoundingClientRect().y).toBe(0);
+ if (ReactNativeFeatureFlags.cxxNativeAnimatedRemoveJsSync()) {
+ // TODO(T232605345): The following two lines won't be necessary once race condition on Android is fixed
+ expect(element.getBoundingClientRect().y).toBe(-16);
+ Fantom.runWorkLoop();
+ expect(element.getBoundingClientRect().y).toBe(0);
+ } else {
+ expect(element.getBoundingClientRect().y).toBe(-16);
+ Fantom.runWorkLoop(); // React update to sync end state of 2nd timing animation in sequence
+ expect(element.getBoundingClientRect().y).toBe(0);
+ }
expect(_isSequenceFinished).toBe(true);
});