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

Commit 5ce2d35

Browse files
committed
✅ (BackHandlerDelegate) test onBackCallback firing
1 parent 674ae27 commit 5ce2d35

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/Navigation/__tests__/BackHandlerDelegate.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@ describe('BackHandlerDelegate', () => {
1616
BackHandler.mockPressBack();
1717
expect.assertions(1);
1818
});
19+
20+
it('fires the registered onBackCallback after the event has been handled', () => {
21+
const spy = jest.fn();
22+
const backHandlerDelegate = new BackHandlerDelegate();
23+
backHandlerDelegate.setOnBackCallback(spy);
24+
backHandlerDelegate.defaultBackContext.back$.subscribe();
25+
BackHandler.mockPressBack();
26+
expect(spy).toHaveBeenCalled();
27+
});
1928
});

0 commit comments

Comments
 (0)