2022-10-31 04:22:08 +00:00
|
|
|
import {NavigationContainer} from '@react-navigation/native'
|
|
|
|
import React from 'react'
|
2022-11-01 05:30:23 +00:00
|
|
|
import {DefaultTheme, Provider as PaperProvider} from 'react-native-paper'
|
2022-10-31 04:22:08 +00:00
|
|
|
import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
|
2022-11-01 05:30:23 +00:00
|
|
|
import {ThemeContext} from './use-theme'
|
2022-10-29 23:56:58 +00:00
|
|
|
|
2022-11-01 05:30:23 +00:00
|
|
|
export const theme = {
|
|
|
|
theme: 'system',
|
|
|
|
setTheme: jest.fn(),
|
|
|
|
color: DefaultTheme.colors.primary,
|
|
|
|
setColor: jest.fn(),
|
|
|
|
}
|
2022-10-29 23:56:58 +00:00
|
|
|
|
|
|
|
export const MockProviders = ({
|
|
|
|
children,
|
|
|
|
}: {
|
2022-10-31 04:22:08 +00:00
|
|
|
children: JSX.Element | JSX.Element[]
|
2022-10-29 23:56:58 +00:00
|
|
|
}) => (
|
2022-10-31 08:32:33 +00:00
|
|
|
<PaperProvider settings={{icon: props => <MaterialIcon {...props} />}}>
|
2022-11-01 05:30:23 +00:00
|
|
|
<ThemeContext.Provider value={theme}>
|
|
|
|
<NavigationContainer>{children}</NavigationContainer>
|
|
|
|
</ThemeContext.Provider>
|
2022-10-31 08:32:33 +00:00
|
|
|
</PaperProvider>
|
2022-10-31 04:22:08 +00:00
|
|
|
)
|