@@ -37,6 +37,10 @@ class FakeQueryList<T> extends QueryList<T> {
37
37
notifyOnChanges ( ) { this . changes . next ( this ) ; }
38
38
}
39
39
40
+ interface KeyEventTestContext {
41
+ nextKeyEvent : KeyboardEvent ;
42
+ prevKeyEvent : KeyboardEvent ;
43
+ }
40
44
41
45
describe ( 'Key managers' , ( ) => {
42
46
let itemList : FakeQueryList < any > ;
@@ -164,7 +168,7 @@ describe('Key managers', () => {
164
168
expect ( fakeKeyEvents . downArrow . defaultPrevented ) . toBe ( false ) ;
165
169
} ) ;
166
170
167
- describe ( 'with `vertical` direction' , ( ) => {
171
+ describe ( 'with `vertical` direction' , function ( this : KeyEventTestContext ) {
168
172
beforeEach ( ( ) => {
169
173
keyManager . withVerticalOrientation ( ) ;
170
174
this . nextKeyEvent = createKeyboardEvent ( 'keydown' , DOWN_ARROW ) ;
@@ -174,7 +178,7 @@ describe('Key managers', () => {
174
178
runDirectionalKeyTests . call ( this ) ;
175
179
} ) ;
176
180
177
- describe ( 'with `ltr` direction' , ( ) => {
181
+ describe ( 'with `ltr` direction' , function ( this : KeyEventTestContext ) {
178
182
beforeEach ( ( ) => {
179
183
keyManager . withHorizontalOrientation ( 'ltr' ) ;
180
184
this . nextKeyEvent = createKeyboardEvent ( 'keydown' , RIGHT_ARROW ) ;
@@ -184,7 +188,7 @@ describe('Key managers', () => {
184
188
runDirectionalKeyTests . call ( this ) ;
185
189
} ) ;
186
190
187
- describe ( 'with `rtl` direction' , ( ) => {
191
+ describe ( 'with `rtl` direction' , function ( this : KeyEventTestContext ) {
188
192
beforeEach ( ( ) => {
189
193
keyManager . withHorizontalOrientation ( 'rtl' ) ;
190
194
this . nextKeyEvent = createKeyboardEvent ( 'keydown' , LEFT_ARROW ) ;
@@ -199,7 +203,7 @@ describe('Key managers', () => {
199
203
* parameters have to be passed in via Jasmine's context object (`this` inside a `beforeEach`)
200
204
* because this function has to run before any `beforeEach`, `beforeAll` etc. hooks.
201
205
*/
202
- function runDirectionalKeyTests ( ) {
206
+ function runDirectionalKeyTests ( this : KeyEventTestContext ) {
203
207
it ( 'should set subsequent items as active when the next key is pressed' , ( ) => {
204
208
keyManager . onKeydown ( this . nextKeyEvent ) ;
205
209
0 commit comments