File tree 1 file changed +24
-25
lines changed
packages/ra-core/src/form
1 file changed +24
-25
lines changed Original file line number Diff line number Diff line change @@ -209,31 +209,30 @@ describe('useInput', () => {
209
209
210
210
it ( 'does not apply the initialValue when input has a value of 0' , ( ) => {
211
211
const { queryByDisplayValue } = renderWithRedux (
212
- < RecordContextProvider value = { { id : 1 , views : 0 } } >
213
- < FormWithRedirect
214
- onSubmit = { jest . fn ( ) }
215
- render = { ( ) => {
216
- return (
217
- < Input
218
- source = "views"
219
- resource = "posts"
220
- initialValue = { 99 }
221
- >
222
- { ( { id, input } ) => {
223
- return (
224
- < input
225
- type = "number"
226
- id = { id }
227
- aria-label = "Views"
228
- { ...input }
229
- />
230
- ) ;
231
- } }
232
- </ Input >
233
- ) ;
234
- } }
235
- />
236
- </ RecordContextProvider >
212
+ < FormWithRedirect
213
+ onSubmit = { jest . fn ( ) }
214
+ record = { { id : 1 , views : 0 } }
215
+ render = { ( ) => {
216
+ return (
217
+ < Input
218
+ source = "views"
219
+ resource = "posts"
220
+ initialValue = { 99 }
221
+ >
222
+ { ( { id, input } ) => {
223
+ return (
224
+ < input
225
+ type = "number"
226
+ id = { id }
227
+ aria-label = "Views"
228
+ { ...input }
229
+ />
230
+ ) ;
231
+ } }
232
+ </ Input >
233
+ ) ;
234
+ } }
235
+ />
237
236
) ;
238
237
expect ( queryByDisplayValue ( '99' ) ) . toBeNull ( ) ;
239
238
} ) ;
You can’t perform that action at this time.
0 commit comments