Skip to content

Commit 65f6e92

Browse files
authored
fix(CI): change order of events in Fabric iOS events e2e test (#2785)
## Description Changed order of events in Fabric iOS events e2e test. The order of events in this test differs from the Paper version of the same test. When screen is removed after using iOS native back button, native side notifies JS via: 1. onDismissed => in reaction to this event, a navigation action is dispatched, which causes emission of beforeRemove event; 2. onDisappear => in reaction to this event, transitionEnd with closing=true is emitted. On Fabric, these events are handled in the same order as the order of notifications from the native side. On Paper, this is not the case - onDismissed is executed after two transitionEnd events are already handled. onDismissed is dispatched asynchronously from the native side (it is wrapped in `dispatch_async`!) and this probably delays handling it on JS side but I am not sure of the details why it is dispatched asynchronously. Currently this divergence between architectures seems to not lead to any issues. Just let it be noted & not forgotten. ## Changes - change order of assertions - add comment with explanation ## Test code and steps to reproduce Run Fabric iOS CI. ## Checklist - [x] Ensured that CI for Fabric iOS passes
1 parent e59f5fc commit 65f6e92

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

FabricExample/e2e/examplesTests/events.e2e.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ const pressBack = async () => {
1212

1313
const awaitClassicalEventBehavior = async () => {
1414
if (device.getPlatform() === 'ios') {
15+
// The order of events in this test differs from the Paper version of the same test.
16+
// Please see https://github.com/software-mansion/react-native-screens/pull/2785 for details.
1517
await expect(
1618
element(by.text('9. Chats | transitionStart | closing')),
1719
).toExist();
@@ -21,14 +23,14 @@ const awaitClassicalEventBehavior = async () => {
2123
await expect(
2224
element(by.text('11. Main | transitionStart | opening')),
2325
).toExist();
26+
await expect(element(by.text('12. Privacy | beforeRemove'))).toExist();
27+
await expect(element(by.text('13. Chats | beforeRemove'))).toExist();
2428
await expect(
25-
element(by.text('12. Chats | transitionEnd | closing')),
29+
element(by.text('14. Chats | transitionEnd | closing')),
2630
).toExist();
2731
await expect(
28-
element(by.text('13. Privacy | transitionEnd | closing')),
32+
element(by.text('15. Privacy | transitionEnd | closing')),
2933
).toExist();
30-
await expect(element(by.text('14. Privacy | beforeRemove'))).toExist();
31-
await expect(element(by.text('15. Chats | beforeRemove'))).toExist();
3234
await expect(
3335
element(by.text('16. Main | transitionEnd | opening')),
3436
).toExist();

0 commit comments

Comments
 (0)