1
1
import { act , renderHook , waitFor } from '@testing-library/react' ;
2
2
import { sleep } from '../../utils/testingHelpers' ;
3
3
import useAntdTable from '../index' ;
4
+ import { useEffect } from 'react' ;
5
+ import { Form } from 'antd' ;
4
6
5
7
interface Query {
6
8
current : number ;
@@ -23,7 +25,7 @@ describe('useAntdTable', () => {
23
25
24
26
let searchType = 'simple' ;
25
27
26
- const form : any = {
28
+ const form = {
27
29
getInternalHooks : ( ) => { } ,
28
30
initialValue : {
29
31
name : 'default name' ,
@@ -348,10 +350,10 @@ describe('useAntdTable', () => {
348
350
} ) ;
349
351
} ) ;
350
352
351
- it ( " should defaultParams work with manual is true" , async ( ) => {
353
+ it ( ' should defaultParams work with manual is true' , async ( ) => {
352
354
queryArgs = undefined ;
353
355
form . resetFields ( ) ;
354
- changeSearchType ( " advance" ) ;
356
+ changeSearchType ( ' advance' ) ;
355
357
356
358
act ( ( ) => {
357
359
renderHook ( ( o ) => {
@@ -366,15 +368,15 @@ describe('useAntdTable', () => {
366
368
current : 2 ,
367
369
pageSize : 10 ,
368
370
} ,
369
- { name : " hello" , phone : " 123" } ,
371
+ { name : ' hello' , phone : ' 123' } ,
370
372
] ,
371
- defaultType : " advance" ,
372
- }
373
+ defaultType : ' advance' ,
374
+ } ,
373
375
) ;
374
376
375
377
useEffect ( ( ) => {
376
378
// defaultParams works
377
- expect ( myForm . getFieldValue ( " name" ) ) . toBe ( " hello" ) ;
379
+ expect ( myForm . getFieldValue ( ' name' ) ) . toBe ( ' hello' ) ;
378
380
expect ( queryArgs ) . toBe ( undefined ) ;
379
381
} , [ ] ) ;
380
382
} ) ;
0 commit comments