Skip to content

Commit cf26dad

Browse files
alanleedevfacebook-github-bot
authored andcommitted
Fix Modal Fantom test by flushing message queue
Summary: The Modal Fantom test was failing in CI with "MessageQueue is not empty" error. This was caused by Modal's componentDidMount subscribing to ModalEventEmitter, which schedules work in the message queue. When Fantom's afterEach hook runs validateEmptyMessageQueue(), it detects pending work and fails the test. Added Fantom.runWorkLoop() call at the end of the test to flush any pending messages in the queue before the test completes. This follows the established pattern used throughout the Fantom test suite for handling async operations. Changelog: [Internal] Fix Fantom test Differential Revision: D88538595
1 parent a9a0268 commit cf26dad

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/react-native/Libraries/Modal/__tests__/Modal-itest.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ describe('<Modal>', () => {
5757
<rn-view />
5858
</rn-modalHostView>,
5959
);
60+
61+
// Flush message queue to handle Modal's componentDidMount event listener setup
62+
Fantom.runWorkLoop();
6063
});
6164

6265
(['slide', 'fade'] as const).forEach(animationType => {

0 commit comments

Comments
 (0)