|
|
|
@ -8,22 +8,21 @@ import {
|
|
|
|
|
import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
|
|
|
|
|
import {ThemeContext} from './use-theme'
|
|
|
|
|
|
|
|
|
|
export const theme = {
|
|
|
|
|
theme: 'system',
|
|
|
|
|
setTheme: jest.fn(),
|
|
|
|
|
lightColor: DefaultTheme.colors.primary,
|
|
|
|
|
darkColor: DarkTheme.colors.primary,
|
|
|
|
|
setLightColor: jest.fn(),
|
|
|
|
|
setDarkColor: jest.fn(),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const MockProviders = ({
|
|
|
|
|
children,
|
|
|
|
|
}: {
|
|
|
|
|
children: JSX.Element | JSX.Element[]
|
|
|
|
|
}) => (
|
|
|
|
|
<PaperProvider settings={{icon: props => <MaterialIcon {...props} />}}>
|
|
|
|
|
<ThemeContext.Provider value={theme}>
|
|
|
|
|
<ThemeContext.Provider
|
|
|
|
|
value={{
|
|
|
|
|
theme: 'system',
|
|
|
|
|
setTheme: jest.fn(),
|
|
|
|
|
lightColor: DefaultTheme.colors.primary,
|
|
|
|
|
darkColor: DarkTheme.colors.primary,
|
|
|
|
|
setLightColor: jest.fn(),
|
|
|
|
|
setDarkColor: jest.fn(),
|
|
|
|
|
}}>
|
|
|
|
|
<NavigationContainer>{children}</NavigationContainer>
|
|
|
|
|
</ThemeContext.Provider>
|
|
|
|
|
</PaperProvider>
|
|
|
|
|