@@ -210,7 +210,10 @@ describe('Form', () => {
210
210
fireEvent . click ( screen . getByText ( 'Submit' ) ) ;
211
211
212
212
await waitFor ( ( ) => {
213
- expect ( onSubmit ) . toHaveBeenCalledWith ( { foo : null } ) ;
213
+ expect ( onSubmit ) . toHaveBeenCalledWith (
214
+ { foo : null } ,
215
+ expect . anything ( )
216
+ ) ;
214
217
} ) ;
215
218
} ) ;
216
219
@@ -235,7 +238,10 @@ describe('Form', () => {
235
238
fireEvent . click ( screen . getByText ( 'Submit' ) ) ;
236
239
237
240
await waitFor ( ( ) => {
238
- expect ( onSubmit ) . toHaveBeenCalledWith ( { foo : { bar : null } } ) ;
241
+ expect ( onSubmit ) . toHaveBeenCalledWith (
242
+ { foo : { bar : null } } ,
243
+ expect . anything ( )
244
+ ) ;
239
245
} ) ;
240
246
} ) ;
241
247
@@ -257,7 +263,10 @@ describe('Form', () => {
257
263
fireEvent . click ( screen . getByText ( 'Submit' ) ) ;
258
264
259
265
await waitFor ( ( ) => {
260
- expect ( onSubmit ) . toHaveBeenCalledWith ( { foo : str } ) ;
266
+ expect ( onSubmit ) . toHaveBeenCalledWith (
267
+ { foo : str } ,
268
+ expect . anything ( )
269
+ ) ;
261
270
} ) ;
262
271
} ) ;
263
272
it ( 'should accept date values' , async ( ) => {
@@ -283,7 +292,10 @@ describe('Form', () => {
283
292
fireEvent . click ( screen . getByText ( 'Submit' ) ) ;
284
293
285
294
await waitFor ( ( ) => {
286
- expect ( onSubmit ) . toHaveBeenCalledWith ( { foo : date } ) ;
295
+ expect ( onSubmit ) . toHaveBeenCalledWith (
296
+ { foo : date } ,
297
+ expect . anything ( )
298
+ ) ;
287
299
} ) ;
288
300
} ) ;
289
301
@@ -310,7 +322,10 @@ describe('Form', () => {
310
322
fireEvent . click ( screen . getByText ( 'Submit' ) ) ;
311
323
312
324
await waitFor ( ( ) => {
313
- expect ( onSubmit ) . toHaveBeenCalledWith ( { foo : arr } ) ;
325
+ expect ( onSubmit ) . toHaveBeenCalledWith (
326
+ { foo : arr } ,
327
+ expect . anything ( )
328
+ ) ;
314
329
} ) ;
315
330
} ) ;
316
331
@@ -337,7 +352,10 @@ describe('Form', () => {
337
352
fireEvent . click ( screen . getByText ( 'Submit' ) ) ;
338
353
339
354
await waitFor ( ( ) => {
340
- expect ( onSubmit ) . toHaveBeenCalledWith ( { foo : obj } ) ;
355
+ expect ( onSubmit ) . toHaveBeenCalledWith (
356
+ { foo : obj } ,
357
+ expect . anything ( )
358
+ ) ;
341
359
} ) ;
342
360
} ) ;
343
361
it ( 'should accept deep object values' , async ( ) => {
@@ -363,7 +381,10 @@ describe('Form', () => {
363
381
fireEvent . click ( screen . getByText ( 'Submit' ) ) ;
364
382
365
383
await waitFor ( ( ) => {
366
- expect ( onSubmit ) . toHaveBeenCalledWith ( { foo : obj } ) ;
384
+ expect ( onSubmit ) . toHaveBeenCalledWith (
385
+ { foo : obj } ,
386
+ expect . anything ( )
387
+ ) ;
367
388
} ) ;
368
389
} ) ;
369
390
it ( 'should accept object values in arrays' , async ( ) => {
@@ -389,7 +410,10 @@ describe('Form', () => {
389
410
fireEvent . click ( screen . getByText ( 'Submit' ) ) ;
390
411
391
412
await waitFor ( ( ) => {
392
- expect ( onSubmit ) . toHaveBeenCalledWith ( { foo : obj } ) ;
413
+ expect ( onSubmit ) . toHaveBeenCalledWith (
414
+ { foo : obj } ,
415
+ expect . anything ( )
416
+ ) ;
393
417
} ) ;
394
418
} ) ;
395
419
it ( 'should accept adding objects in arrays' , async ( ) => {
@@ -418,7 +442,10 @@ describe('Form', () => {
418
442
fireEvent . click ( screen . getByText ( 'Submit' ) ) ;
419
443
420
444
await waitFor ( ( ) => {
421
- expect ( onSubmit ) . toHaveBeenCalledWith ( { foo : obj } ) ;
445
+ expect ( onSubmit ) . toHaveBeenCalledWith (
446
+ { foo : obj } ,
447
+ expect . anything ( )
448
+ ) ;
422
449
} ) ;
423
450
} ) ;
424
451
it ( 'should accept removing objects in array of objects' , async ( ) => {
@@ -449,7 +476,10 @@ describe('Form', () => {
449
476
fireEvent . click ( screen . getByText ( 'Submit' ) ) ;
450
477
451
478
await waitFor ( ( ) => {
452
- expect ( onSubmit ) . toHaveBeenCalledWith ( { foo : obj } ) ;
479
+ expect ( onSubmit ) . toHaveBeenCalledWith (
480
+ { foo : obj } ,
481
+ expect . anything ( )
482
+ ) ;
453
483
} ) ;
454
484
} ) ;
455
485
describe ( 'defaultValues' , ( ) => {
@@ -519,7 +549,10 @@ describe('Form', () => {
519
549
fireEvent . click ( screen . getByText ( 'Submit' ) ) ;
520
550
521
551
await waitFor ( ( ) => {
522
- expect ( onSubmit ) . toHaveBeenCalledWith ( values ) ;
552
+ expect ( onSubmit ) . toHaveBeenCalledWith (
553
+ values ,
554
+ expect . anything ( )
555
+ ) ;
523
556
} ) ;
524
557
} ) ;
525
558
} ) ;
0 commit comments