From ad99199d50ebbe2bb9a935ed2c8bd11be9981fe2 Mon Sep 17 00:00:00 2001 From: Julie Ralph Date: Wed, 2 Dec 2015 11:54:10 -0800 Subject: [PATCH] chore(test): remove deprecated RootTestComponent Uses of `RootTestComponent` should be migrated to `ComponentFixture`. --- modules/angular2/src/testing/test_component_builder.ts | 7 ++----- .../test/router/integration/auxiliary_route_spec.ts | 6 +++--- .../test/router/integration/impl/async_route_spec_impl.ts | 4 ++-- .../test/router/integration/impl/sync_route_spec_impl.ts | 4 ++-- .../test/router/integration/redirect_route_spec.ts | 4 ++-- modules/angular2/test/router/integration/util.ts | 2 +- modules/angular2/testing.ts | 6 +----- 7 files changed, 13 insertions(+), 20 deletions(-) diff --git a/modules/angular2/src/testing/test_component_builder.ts b/modules/angular2/src/testing/test_component_builder.ts index 89a42be321..103c96621d 100644 --- a/modules/angular2/src/testing/test_component_builder.ts +++ b/modules/angular2/src/testing/test_component_builder.ts @@ -24,9 +24,9 @@ import {DebugElement, DebugElement_} from 'angular2/src/core/debug/debug_element /** - * @deprecated Use ComponentFixture + * Fixture for debugging and testing a component. */ -export abstract class RootTestComponent { +export abstract class ComponentFixture { debugElement: DebugElement; abstract detectChanges(): void; @@ -34,9 +34,6 @@ export abstract class RootTestComponent { } -export abstract class ComponentFixture extends RootTestComponent {} - - export class ComponentFixture_ extends ComponentFixture { /** @internal */ _componentRef: ComponentRef; diff --git a/modules/angular2/test/router/integration/auxiliary_route_spec.ts b/modules/angular2/test/router/integration/auxiliary_route_spec.ts index 14615bc466..880e4cff3d 100644 --- a/modules/angular2/test/router/integration/auxiliary_route_spec.ts +++ b/modules/angular2/test/router/integration/auxiliary_route_spec.ts @@ -1,5 +1,5 @@ import { - RootTestComponent, + ComponentFixture, AsyncTestCompleter, TestComponentBuilder, beforeEach, @@ -22,7 +22,7 @@ import {RouteConfig, Route, AuxRoute, Redirect} from 'angular2/src/router/route_ import {TEST_ROUTER_PROVIDERS, RootCmp, compile, clickOnElement, getHref} from './util'; -function getLinkElement(rtc: RootTestComponent) { +function getLinkElement(rtc: ComponentFixture) { return rtc.debugElement.componentViewChildren[0].nativeElement; } @@ -33,7 +33,7 @@ export function main() { describe('auxiliary routes', () => { var tcb: TestComponentBuilder; - var fixture: RootTestComponent; + var fixture: ComponentFixture; var rtr; beforeEachProviders(() => TEST_ROUTER_PROVIDERS); diff --git a/modules/angular2/test/router/integration/impl/async_route_spec_impl.ts b/modules/angular2/test/router/integration/impl/async_route_spec_impl.ts index 583e4ecef8..db46dc39b2 100644 --- a/modules/angular2/test/router/integration/impl/async_route_spec_impl.ts +++ b/modules/angular2/test/router/integration/impl/async_route_spec_impl.ts @@ -8,7 +8,7 @@ import { inject, it, TestComponentBuilder, - RootTestComponent, + ComponentFixture, xit, } from 'angular2/testing_internal'; @@ -32,7 +32,7 @@ import { asyncRouteDataCmp } from './fixture_components'; -function getLinkElement(rtc: RootTestComponent) { +function getLinkElement(rtc: ComponentFixture) { return rtc.debugElement.componentViewChildren[0].nativeElement; } diff --git a/modules/angular2/test/router/integration/impl/sync_route_spec_impl.ts b/modules/angular2/test/router/integration/impl/sync_route_spec_impl.ts index 15fbc3514c..d621fa4d47 100644 --- a/modules/angular2/test/router/integration/impl/sync_route_spec_impl.ts +++ b/modules/angular2/test/router/integration/impl/sync_route_spec_impl.ts @@ -8,7 +8,7 @@ import { inject, it, TestComponentBuilder, - RootTestComponent, + ComponentFixture, xit, } from 'angular2/testing_internal'; @@ -19,7 +19,7 @@ import {Router, Route, Location} from 'angular2/router'; import {HelloCmp, UserCmp, TeamCmp, ParentCmp, ParentWithDefaultCmp} from './fixture_components'; -function getLinkElement(rtc: RootTestComponent) { +function getLinkElement(rtc: ComponentFixture) { return rtc.debugElement.componentViewChildren[0].nativeElement; } diff --git a/modules/angular2/test/router/integration/redirect_route_spec.ts b/modules/angular2/test/router/integration/redirect_route_spec.ts index 7f8bb28a92..4c2f195b3d 100644 --- a/modules/angular2/test/router/integration/redirect_route_spec.ts +++ b/modules/angular2/test/router/integration/redirect_route_spec.ts @@ -1,5 +1,5 @@ import { - RootTestComponent, + ComponentFixture, AsyncTestCompleter, TestComponentBuilder, beforeEach, @@ -34,7 +34,7 @@ export function main() { describe('redirects', () => { var tcb: TestComponentBuilder; - var rootTC: RootTestComponent; + var rootTC: ComponentFixture; var rtr; beforeEachProviders(() => TEST_ROUTER_PROVIDERS); diff --git a/modules/angular2/test/router/integration/util.ts b/modules/angular2/test/router/integration/util.ts index 08abbf3438..5610d99b78 100644 --- a/modules/angular2/test/router/integration/util.ts +++ b/modules/angular2/test/router/integration/util.ts @@ -3,7 +3,7 @@ import {Type, isBlank} from 'angular2/src/facade/lang'; import {BaseException} from 'angular2/src/facade/exceptions'; import { - RootTestComponent, + ComponentFixture, AsyncTestCompleter, TestComponentBuilder, beforeEach, diff --git a/modules/angular2/testing.ts b/modules/angular2/testing.ts index 896cb26d4b..973f04afe6 100644 --- a/modules/angular2/testing.ts +++ b/modules/angular2/testing.ts @@ -7,11 +7,7 @@ * */ export * from './src/testing/testing'; -export { - ComponentFixture, - RootTestComponent, - TestComponentBuilder -} from './src/testing/test_component_builder'; +export {ComponentFixture, TestComponentBuilder} from './src/testing/test_component_builder'; export * from './src/testing/test_injector'; export * from './src/testing/fake_async';