File tree 2 files changed +26
-0
lines changed 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import HTMLEngineProvider from '../src/components/HTMLEngineProvider';
6
6
import OnyxProvider from '../src/components/OnyxProvider' ;
7
7
import { LocaleContextProvider } from '../src/components/withLocalize' ;
8
8
import ONYXKEYS from '../src/ONYXKEYS' ;
9
+ import MockNavigationProvider from '../__mocks__/MockNavigationProvider' ;
9
10
10
11
Onyx . init ( {
11
12
keys : ONYXKEYS ,
@@ -18,6 +19,7 @@ const decorators = [
18
19
OnyxProvider ,
19
20
LocaleContextProvider ,
20
21
HTMLEngineProvider ,
22
+ MockNavigationProvider ,
21
23
] }
22
24
>
23
25
< Story />
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import PropTypes from 'prop-types' ;
3
+ import { NavigationContext } from '@react-navigation/native' ;
4
+
5
+ const propTypes = {
6
+ /** Rendered child component */
7
+ children : PropTypes . node . isRequired ,
8
+ } ;
9
+
10
+ const MockNavigationProvider = props => (
11
+ < NavigationContext . Provider
12
+ value = { {
13
+ isFocused : ( ) => true ,
14
+ addListener : ( ) => { } ,
15
+ removeListener : ( ) => { } ,
16
+ } }
17
+ >
18
+ { props . children }
19
+ </ NavigationContext . Provider >
20
+ ) ;
21
+
22
+ MockNavigationProvider . propTypes = propTypes ;
23
+
24
+ export default MockNavigationProvider ;
You can’t perform that action at this time.
0 commit comments