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
This commit is contained in:
Riccardo Cipolleschi
2025-08-08 08:52:46 -07:00
committed by Facebook GitHub Bot
parent 2812e20ecc
commit 01e3f8d75e
@@ -268,6 +268,31 @@ describe('<Modal>', () => {
);
});
});
describe('visible', () => {
it('renders a Modal with visible="true"', () => {
const root = Fantom.createRoot();
Fantom.runTask(() => {
root.render(<Modal visible={true} />);
});
expect(root.getRenderedOutput({props: ['visible']}).toJSX()).toEqual(
<rn-modalHostView visible="true">
<rn-view />
</rn-modalHostView>,
);
});
it('renders nothing when visible="false"', () => {
const root = Fantom.createRoot();
Fantom.runTask(() => {
root.render(<Modal visible={false} />);
});
expect(root.getRenderedOutput({props: ['visible']}).toJSX()).toBeNull();
});
});
// ... more props
});
describe('ref', () => {