Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit 4f05b2e

Browse files
committed
feat(line-ripple): typescript issues in tests
1 parent 5f2dc87 commit 4f05b2e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/unit/line-ripple/index.test.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import * as td from 'testdouble';
33
import {assert} from 'chai';
44
import {shallow} from 'enzyme';
55
import LineRipple from '../../../packages/line-ripple/index';
6+
import {MDCLineRippleFoundation} from '@material/line-ripple/foundation';
67
import {MDCLineRippleAdapter} from '@material/line-ripple/adapter';
78
import {coerceForTesting} from '../helpers/types';
89

910
suite('LineRipple');
1011

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
1214
return foundation.adapter_;
1315
}
1416

@@ -109,11 +111,11 @@ test('#adapter.setStyle updates style', () => {
109111
test('onTransitionEnd calls the #foundation.handleTransitionEnd', () => {
110112
const wrapper = shallow<LineRipple>(<LineRipple />);
111113
wrapper.instance().foundation_.handleTransitionEnd = td.func<(env: TransitionEvent) => null>();
112-
const event: React.TransitionEvent = {
114+
const event: React.TransitionEvent = coerceForTesting<React.TransitionEvent>({
113115
nativeEvent: {
114116
test: '123',
115117
},
116-
} as any;
118+
});
117119
wrapper.simulate('transitionEnd', event);
118120
td.verify(wrapper.instance().foundation_.handleTransitionEnd(event.nativeEvent), {
119121
times: 1,

0 commit comments

Comments
 (0)