1
1
import { cleanup , fireEvent , render } from '@testing-library/react' ;
2
2
import React from 'react' ;
3
- import Trigger , { UniqueProvider } from '../src' ;
3
+ import Trigger , { UniqueProvider , type UniqueProviderProps } from '../src' ;
4
4
import { awaitFakeTimer } from './util' ;
5
5
import type { TriggerProps } from '../src' ;
6
6
import classNames from 'classnames' ;
@@ -257,9 +257,14 @@ describe('Trigger.Unique', () => {
257
257
} ) ;
258
258
259
259
it ( 'should apply postTriggerProps to customize options' , async ( ) => {
260
- const postTriggerProps = ( options : any ) => ( {
260
+ const postTriggerProps : UniqueProviderProps [ 'postTriggerProps' ] = (
261
+ options ,
262
+ ) => ( {
261
263
...options ,
262
- popupClassName : classNames ( options . popupClassName , 'custom-post-options-class' ) ,
264
+ popupClassName : classNames (
265
+ options . popupClassName ,
266
+ 'custom-post-options-class' ,
267
+ ) ,
263
268
} ) ;
264
269
265
270
render (
@@ -276,6 +281,8 @@ describe('Trigger.Unique', () => {
276
281
) ;
277
282
278
283
// Check that the custom class from postTriggerProps is applied
279
- expect ( document . querySelector ( '.rc-trigger-popup' ) ) . toHaveClass ( 'custom-post-options-class' ) ;
284
+ expect ( document . querySelector ( '.rc-trigger-popup' ) ) . toHaveClass (
285
+ 'custom-post-options-class' ,
286
+ ) ;
280
287
} ) ;
281
288
} ) ;
0 commit comments