File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export interface RenderOptions<
7070 *
7171 * @see https://testing-library.com/docs/react-testing-library/api/#wrapper
7272 */
73- wrapper ?: React . ComponentType
73+ wrapper ?: React . ComponentType < { children : React . ReactElement } >
7474}
7575
7676type Omit < T , K extends keyof T > = Pick < T , Exclude < keyof T , K > >
Original file line number Diff line number Diff line change @@ -100,6 +100,28 @@ export function testQueries() {
100100 )
101101}
102102
103+ export function wrappedRender (
104+ ui : React . ReactElement ,
105+ options ?: pure . RenderOptions ,
106+ ) {
107+ const Wrapper = ( { children} : { children : React . ReactElement } ) : JSX . Element => {
108+ return < div > { children } </ div >
109+ }
110+
111+ return pure . render ( ui , { wrapper : Wrapper , ...options } )
112+ }
113+
114+ export function wrappedRenderB (
115+ ui : React . ReactElement ,
116+ options ?: pure . RenderOptions ,
117+ ) {
118+ const Wrapper : React . FunctionComponent = ( { children} ) => {
119+ return < div > { children } </ div >
120+ }
121+
122+ return pure . render ( ui , { wrapper : Wrapper , ...options } )
123+ }
124+
103125/*
104126eslint
105127 testing-library/prefer-explicit-assert: "off",
You can’t perform that action at this time.
0 commit comments