Finished testing implementation
This commit is contained in:
15
FastNotes/test-utils/renderWithTheme.tsx
Normal file
15
FastNotes/test-utils/renderWithTheme.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { render, RenderOptions } from "@testing-library/react-native"
|
||||
import React, { PropsWithChildren, ReactElement } from "react"
|
||||
|
||||
import { AppThemeProvider } from "@/src/theme/AppThemeProvider"
|
||||
|
||||
function ThemeWrapper({ children }: PropsWithChildren) {
|
||||
return <AppThemeProvider>{children}</AppThemeProvider>
|
||||
}
|
||||
|
||||
export function renderWithTheme(ui: ReactElement, options?: Omit<RenderOptions, "wrapper">) {
|
||||
return render(ui, {
|
||||
wrapper: ThemeWrapper,
|
||||
...options,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user