You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
839 B
TypeScript
30 lines
839 B
TypeScript
import {NavigationContainer} from '@react-navigation/native'
|
|
import React from 'react'
|
|
import {
|
|
DarkTheme,
|
|
DefaultTheme,
|
|
Provider as PaperProvider,
|
|
} from 'react-native-paper'
|
|
import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
|
|
import {ThemeContext} from './use-theme'
|
|
|
|
export const MockProviders = ({
|
|
children,
|
|
}: {
|
|
children: JSX.Element | JSX.Element[]
|
|
}) => (
|
|
<PaperProvider settings={{icon: props => <MaterialIcon {...props} />}}>
|
|
<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>
|
|
)
|