Skip to content

Commit e89fa59

Browse files
Riccardo Cipolleschifacebook-github-bot
authored andcommitted
Add tests for Modal.animiated prop
Summary: Add Fantom tests for Modal.animiated prop Notice that animated is deprecated and ignored when rendering. ## Changelog: [Internal] - Differential Revision: D79888036
1 parent 0edae86 commit e89fa59

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,26 @@ describe('<Modal>', () => {
326326
);
327327
});
328328
});
329+
330+
describe('animated', () => {
331+
[true, false].forEach(animated => {
332+
// The 'animated' prop is deprecated and ignored when the Modal is rendered
333+
// Users should use the 'animationType' prop instead.
334+
it(`[DEPRECATED] renders a Modal with animated="${animated ? 'true' : 'false'}"`, () => {
335+
const root = Fantom.createRoot();
336+
337+
Fantom.runTask(() => {
338+
root.render(<Modal animated={animated} />);
339+
});
340+
341+
expect(root.getRenderedOutput({props: ['animated']}).toJSX()).toEqual(
342+
<rn-modalHostView>
343+
<rn-view />
344+
</rn-modalHostView>,
345+
);
346+
});
347+
});
348+
});
329349
// ... more props
330350
});
331351
describe('ref', () => {

0 commit comments

Comments
 (0)