Skip to content

Commit 8de3b98

Browse files
devversionmmalerba
authored andcommitted
refactor: move testing utilities to cdk (#5437)
* Deletes the duplicate testing utilities because #5386 just copied them to the CDK but didn't delete the old files. * Introduces a secondary entry point (only inside of development right now) that allows us to use the testing utilities from the Material package tests
1 parent ac3e21a commit 8de3b98

36 files changed

+60
-170
lines changed

src/cdk/keyboard/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
export * from './keycodes';

src/cdk/public_api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ export * from './platform/index';
1414
export * from './portal/index';
1515
export * from './rxjs/index';
1616
export * from './observe-content/index';
17-
export * from './keyboard/keycodes';
17+
export * from './keyboard/index';

src/cdk/testing/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
export * from './dispatch-events';
10+
export * from './event-objects';
11+
export * from './type-in-element';
12+
export * from './wrapped-error-message';
File renamed without changes.

src/cdk/tsconfig-tests.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
"types": ["jasmine"],
1111
"experimentalDecorators": true
1212
},
13+
"files": [
14+
"./index.ts",
15+
"./testing/index.ts"
16+
],
1317
"include": [
14-
"**/*.spec.ts",
15-
"index.ts"
18+
"**/*.spec.ts"
1619
]
1720
}

src/lib/autocomplete/autocomplete.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ import {MdOption} from '../core/option/option';
2626
import {MdInputContainer} from '../input/input-container';
2727
import {Observable} from 'rxjs/Observable';
2828
import {Subject} from 'rxjs/Subject';
29-
import {dispatchFakeEvent} from '../core/testing/dispatch-events';
30-
import {createKeyboardEvent} from '../core/testing/event-objects';
31-
import {typeInElement} from '../core/testing/type-in-element';
29+
import {createKeyboardEvent, dispatchFakeEvent, typeInElement} from '@angular/cdk/testing';
3230
import {ScrollDispatcher} from '../core/overlay/scroll/scroll-dispatcher';
3331
import {RxChain, map, startWith, filter} from '../core/rxjs/index';
3432

src/lib/checkbox/checkbox.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {By} from '@angular/platform-browser';
1212
import {MdCheckbox, MdCheckboxChange, MdCheckboxModule} from './index';
1313
import {ViewportRuler} from '../core/overlay/position/viewport-ruler';
1414
import {FakeViewportRuler} from '../core/overlay/position/fake-viewport-ruler';
15-
import {dispatchFakeEvent} from '../core/testing/dispatch-events';
15+
import {dispatchFakeEvent} from '@angular/cdk/testing';
1616
import {RIPPLE_FADE_IN_DURATION, RIPPLE_FADE_OUT_DURATION} from '../core/ripple/ripple-renderer';
1717

1818

src/lib/chips/chip-list.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {By} from '@angular/platform-browser';
44
import {MdChip, MdChipList, MdChipsModule} from './index';
55
import {FocusKeyManager} from '../core/a11y/focus-key-manager';
66
import {SPACE, LEFT_ARROW, RIGHT_ARROW, TAB} from '../core/keyboard/keycodes';
7-
import {createKeyboardEvent} from '../core/testing/event-objects';
7+
import {createKeyboardEvent} from '@angular/cdk/testing';
88

99

1010
describe('MdChipList', () => {

src/lib/core/compatibility/compatibility.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
MD_ELEMENTS_SELECTOR,
88
getMdCompatibilityInvalidPrefixError,
99
} from './compatibility';
10-
import {wrappedErrorMessage} from '../testing/wrapped-error-message';
10+
import {wrappedErrorMessage} from '@angular/cdk/testing';
1111

1212

1313
describe('Style compatibility', () => {

0 commit comments

Comments
 (0)