mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
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', () => {
|
||||
|
||||
Reference in New Issue
Block a user