File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -260,8 +260,7 @@ declare namespace matchers {
260
260
* @see
261
261
* [testing-library/jest-dom#tohaveclass](https://github.com/testing-library/jest-dom#tohaveclass)
262
262
*/
263
- toHaveClass ( classNames : string , options ?: { exact : boolean } ) : R
264
- toHaveClass ( ...classNames : Array < string | RegExp > ) : R
263
+ toHaveClass ( ...classNames : ( string | RegExp ) [ ] | [ string , options ?: { exact : boolean } ] ) : R
265
264
/**
266
265
* @description
267
266
* This allows you to check whether the given form element has the specified displayed value (the one the
Original file line number Diff line number Diff line change @@ -31,6 +31,20 @@ describe('dom related activity', () => {
31
31
expect ( screenshotPath ) . toMatch (
32
32
/ _ _ s c r e e n s h o t s _ _ \/ d o m .t e s t .t s \/ d o m - r e l a t e d - a c t i v i t y - r e n d e r s - d i v - 1 .p n g / ,
33
33
)
34
+
35
+ // test typing
36
+ if ( 0 ) {
37
+ await expect . element ( div ) . toHaveClass ( 'x' , { exact : true } )
38
+ await expect . element ( div ) . toHaveClass ( 'x' , 'y' )
39
+ await expect . element ( div ) . toHaveClass ( 'x' , / y / )
40
+ await expect . element ( div ) . toHaveClass ( / x / , 'y' )
41
+ await expect . element ( div ) . toHaveClass ( 'x' , / y / , 'z' )
42
+ await expect . element ( div ) . toHaveClass ( / x / , 'y' , / z / )
43
+ // @ts -expect-error error
44
+ await expect . element ( div ) . toHaveClass ( 'x' , { exact : 1234 } )
45
+ // @ts -expect-error error
46
+ await expect . element ( div ) . toHaveClass ( 'x' , 1234 )
47
+ }
34
48
} )
35
49
36
50
test ( 'resolves base64 screenshot' , async ( ) => {
You can’t perform that action at this time.
0 commit comments