mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add tests for Modal.navigationBarTranslucent prop (#53157)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53157 Add Fantom tests for Modal.navigationBarTranslucent prop ## Changelog: [Internal] - Reviewed By: andrewdacenko Differential Revision: D79881358 fbshipit-source-id: 75816bf9bb18dc2115477965953fcd88a65d5be5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
de76f3436c
commit
674fd79eaf
@@ -186,7 +186,55 @@ describe('<Modal>', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('navigationBarTranslucent', () => {
|
||||
it('renders a Modal with navigationBarTranslucent="true" and statusBarTranslucent="true"', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
// navigationBarTranslucent=true with statusBarTranslucent=false is not supported
|
||||
// and it emits a warning.
|
||||
root.render(
|
||||
<Modal
|
||||
navigationBarTranslucent={true}
|
||||
statusBarTranslucent={true}
|
||||
/>,
|
||||
);
|
||||
});
|
||||
|
||||
expect(
|
||||
root
|
||||
.getRenderedOutput({
|
||||
props: ['navigationBarTranslucent', 'statusBarTranslucent'],
|
||||
})
|
||||
.toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView
|
||||
navigationBarTranslucent="true"
|
||||
statusBarTranslucent="true">
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
it('renders a Modal with navigationBarTranslucent="false"', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal navigationBarTranslucent={false} />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root
|
||||
.getRenderedOutput({
|
||||
props: ['navigationBarTranslucent', 'statusBarTranslucent'],
|
||||
})
|
||||
.toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView>
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
});
|
||||
// ... more props
|
||||
});
|
||||
describe('ref', () => {
|
||||
|
||||
Reference in New Issue
Block a user