From 01e3f8d75e8ea0dc0668b8abde3da9a033d32757 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Fri, 8 Aug 2025 08:52:46 -0700 Subject: [PATCH] Add tests for Modal.visible prop (#53172) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53172 Add Fantom tests for Modal.visible prop ## Changelog: [Internal] - Reviewed By: andrewdacenko Differential Revision: D79884676 fbshipit-source-id: 7c3ca4e16596022096a634a7232b616cf15c79c4 --- .../Libraries/Modal/__tests__/Modal-itest.js | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js b/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js index c858bbc7dde..1651e54a716 100644 --- a/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js +++ b/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js @@ -268,6 +268,31 @@ describe('', () => { ); }); }); + + describe('visible', () => { + it('renders a Modal with visible="true"', () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render(); + }); + + expect(root.getRenderedOutput({props: ['visible']}).toJSX()).toEqual( + + + , + ); + }); + it('renders nothing when visible="false"', () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render(); + }); + + expect(root.getRenderedOutput({props: ['visible']}).toJSX()).toBeNull(); + }); + }); // ... more props }); describe('ref', () => {