@@ -28,39 +28,42 @@ describe('react-testing-library config', () => {
2828
2929 it ( 'should have rule from extended recommended react-testing-library config' , async ( ) => {
3030 const config = await loadConfig ( ) ;
31- expect ( config . rules ) . toHaveProperty ( 'testing-library/await-async-events' ) ;
31+ expect ( config . rules ) . toHaveProperty ( 'testing-library/await-async-queries' , [
32+ 2 ,
33+ ] ) ;
3234 } ) ;
3335
3436 it ( 'should have explicitly added rule' , async ( ) => {
3537 const config = await loadConfig ( ) ;
36- expect ( config . rules ) . toHaveProperty ( 'testing-library/prefer-user-event' ) ;
38+ expect ( config . rules ) . toHaveProperty ( 'testing-library/prefer-user-event' , [
39+ 1 ,
40+ ] ) ;
3741 } ) ;
3842
3943 it ( 'should have customized severity level for rule from extended config' , async ( ) => {
4044 const config = await loadConfig ( ) ;
41- expect ( config . rules ?. [ 'testing-library/no-await-sync-queries' ] ) . toEqual ( [
42- 1 ,
43- ] ) ;
45+ expect ( config . rules ) . toHaveProperty (
46+ 'testing-library/no-await-sync-queries' ,
47+ [ 1 ] ,
48+ ) ;
4449 } ) ;
4550
4651 it ( 'should have customized rule' , async ( ) => {
4752 const config = await loadConfig ( ) ;
4853 expect ( config . rules ) . toHaveProperty (
4954 'testing-library/prefer-query-matchers' ,
55+ [
56+ 1 ,
57+ {
58+ validEntries : [
59+ { matcher : 'toBeVisible' , query : 'get' } ,
60+ { matcher : 'toHaveTextContent' , query : 'get' } ,
61+ { matcher : 'toBeEnabled' , query : 'get' } ,
62+ { matcher : 'toBeDisabled' , query : 'get' } ,
63+ { matcher : 'toBeChecked' , query : 'get' } ,
64+ ] ,
65+ } ,
66+ ] ,
5067 ) ;
51- expect (
52- config . rules ?. [ 'testing-library/prefer-query-matchers' ] ,
53- ) . toStrictEqual ( [
54- 1 ,
55- {
56- validEntries : [
57- { matcher : 'toBeVisible' , query : 'get' } ,
58- { matcher : 'toHaveTextContent' , query : 'get' } ,
59- { matcher : 'toBeEnabled' , query : 'get' } ,
60- { matcher : 'toBeDisabled' , query : 'get' } ,
61- { matcher : 'toBeChecked' , query : 'get' } ,
62- ] ,
63- } ,
64- ] ) ;
6568 } ) ;
6669} ) ;
0 commit comments