File tree 2 files changed +21
-2
lines changed
2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export interface RenderOptions<
70
70
*
71
71
* @see https://testing-library.com/docs/react-testing-library/api/#wrapper
72
72
*/
73
- wrapper ?: React . ComponentType < { children : React . ReactElement } >
73
+ wrapper ?: React . JSXElementConstructor < { children : React . ReactElement } >
74
74
}
75
75
76
76
type Omit < T , K extends keyof T > = Pick < T , Exclude < keyof T , K > >
Original file line number Diff line number Diff line change @@ -115,13 +115,32 @@ export function wrappedRenderB(
115
115
ui : React . ReactElement ,
116
116
options ?: pure . RenderOptions ,
117
117
) {
118
- const Wrapper : React . FunctionComponent = ( { children} ) => {
118
+ const Wrapper : React . FunctionComponent < { children ?: React . ReactNode } > = ( {
119
+ children,
120
+ } ) => {
119
121
return < div > { children } </ div >
120
122
}
121
123
122
124
return pure . render ( ui , { wrapper : Wrapper , ...options } )
123
125
}
124
126
127
+ export function wrappedRenderC (
128
+ ui : React . ReactElement ,
129
+ options ?: pure . RenderOptions ,
130
+ ) {
131
+ interface AppWrapperProps {
132
+ userProviderProps ?: { user : string }
133
+ }
134
+ const AppWrapperProps : React . FunctionComponent < AppWrapperProps > = ( {
135
+ children,
136
+ userProviderProps = { user : 'TypeScript' } ,
137
+ } ) => {
138
+ return < div data-testid = { userProviderProps . user } > { children } </ div >
139
+ }
140
+
141
+ return pure . render ( ui , { wrapper : AppWrapperProps , ...options } )
142
+ }
143
+
125
144
/*
126
145
eslint
127
146
testing-library/prefer-explicit-assert: "off",
You can’t perform that action at this time.
0 commit comments