This repository was archived by the owner on Jan 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,14 @@ import * as td from 'testdouble';
3
3
import { assert } from 'chai' ;
4
4
import { shallow } from 'enzyme' ;
5
5
import LineRipple from '../../../packages/line-ripple/index' ;
6
+ import { MDCLineRippleFoundation } from '@material/line-ripple/foundation' ;
6
7
import { MDCLineRippleAdapter } from '@material/line-ripple/adapter' ;
7
8
import { coerceForTesting } from '../helpers/types' ;
8
9
9
10
suite ( 'LineRipple' ) ;
10
11
11
- function getAdapter ( foundation : any ) : MDCLineRippleAdapter {
12
+ function getAdapter ( foundation : MDCLineRippleFoundation ) : MDCLineRippleAdapter {
13
+ // @ts -ignore adapter_ property is protected, we need to bypass this check for testing purposes
12
14
return foundation . adapter_ ;
13
15
}
14
16
@@ -109,11 +111,11 @@ test('#adapter.setStyle updates style', () => {
109
111
test ( 'onTransitionEnd calls the #foundation.handleTransitionEnd' , ( ) => {
110
112
const wrapper = shallow < LineRipple > ( < LineRipple /> ) ;
111
113
wrapper . instance ( ) . foundation_ . handleTransitionEnd = td . func < ( env : TransitionEvent ) => null > ( ) ;
112
- const event : React . TransitionEvent = {
114
+ const event : React . TransitionEvent = coerceForTesting < React . TransitionEvent > ( {
113
115
nativeEvent : {
114
116
test : '123' ,
115
117
} ,
116
- } as any ;
118
+ } ) ;
117
119
wrapper . simulate ( 'transitionEnd' , event ) ;
118
120
td . verify ( wrapper . instance ( ) . foundation_ . handleTransitionEnd ( event . nativeEvent ) , {
119
121
times : 1 ,
You can’t perform that action at this time.
0 commit comments