test: fix existing tests by removing usage of obsolete stuff like component level directives, AsyncCompleter and TestComponentBuilder

This commit is contained in:
Igor Minar
2016-08-19 12:51:01 -07:00
parent 939d318242
commit 3c2b2ff332
46 changed files with 251 additions and 326 deletions

View File

@ -8,7 +8,7 @@
import {Component} from '@angular/core';
@Component({selector: 'my-comp', template: '<div></div>', directives: [NextComp]})
@Component({selector: 'my-comp', template: '<div></div>'})
export class MultipleComponentsMyComp {
}

View File

@ -17,7 +17,6 @@ import {MultipleComponentsMyComp} from './a/multiple_components';
templateUrl: './basic.html',
styles: ['.red { color: red }'],
styleUrls: ['./basic.css'],
directives: [MultipleComponentsMyComp, FORM_DIRECTIVES, NgIf, NgFor]
})
export class BasicComp {
ctxProp: string;

View File

@ -32,8 +32,7 @@ export class CompWithProviders {
template: `
<input #a>{{a.value}}
<div *ngIf="true">{{a.value}}</div>
`,
directives: [wrapInArray(common.NgIf)]
`
})
export class CompWithReferences {
}
@ -51,6 +50,6 @@ export class CompUsingPipes {
export class CompUsingCustomElements {
}
@NgModule({schemas: [CUSTOM_ELEMENTS_SCHEMA], declarations: [CompUsingCustomElements]})
@NgModule({schemas: [CUSTOM_ELEMENTS_SCHEMA], declarations: wrapInArray(CompUsingCustomElements)})
export class ModuleUsingCustomElements {
}

View File

@ -11,20 +11,22 @@ import {FormsModule} from '@angular/forms';
import {BrowserModule} from '@angular/platform-browser';
import {MdButtonModule} from '@angular2-material/button';
import {MultipleComponentsMyComp, NextComp} from './a/multiple_components';
import {AnimateCmp} from './animate';
import {BasicComp} from './basic';
import {CompWithAnalyzeEntryComponentsProvider, CompWithEntryComponents} from './entry_components';
import {CompUsingPipes, CompWithProviders, CompWithReferences, ModuleUsingCustomElements} from './features';
import {CompUsingRootModuleDirectiveAndPipe, SomeDirectiveInRootModule, SomePipeInRootModule, SomeService, someLibModuleWithProviders} from './module_fixtures';
import {ProjectingComp} from './projection';
import {CompWithChildQuery, CompWithDirectiveChild} from './queries';
import {CompWithNgContent, ProjectingComp} from './projection';
import {CompForChildQuery, CompWithChildQuery, CompWithDirectiveChild, DirectiveForQuery} from './queries';
@NgModule({
declarations: [
SomeDirectiveInRootModule, SomePipeInRootModule, AnimateCmp, BasicComp, CompWithEntryComponents,
CompWithAnalyzeEntryComponentsProvider, ProjectingComp, CompWithChildQuery,
CompWithDirectiveChild, CompUsingRootModuleDirectiveAndPipe, CompWithProviders,
CompWithReferences, CompUsingPipes
SomeDirectiveInRootModule, SomePipeInRootModule, AnimateCmp, BasicComp, CompForChildQuery,
CompWithEntryComponents, CompWithAnalyzeEntryComponentsProvider, ProjectingComp,
CompWithChildQuery, CompWithDirectiveChild, CompWithNgContent,
CompUsingRootModuleDirectiveAndPipe, CompWithProviders, CompWithReferences, CompUsingPipes,
MultipleComponentsMyComp, DirectiveForQuery, NextComp
],
imports: [
BrowserModule, FormsModule, someLibModuleWithProviders(), ModuleUsingCustomElements,

View File

@ -14,8 +14,7 @@ export class CompWithNgContent {
@Component({
selector: 'main',
template: '<comp-with-proj><span greeting="Hello world!"></span></comp-with-proj>',
directives: [CompWithNgContent]
template: '<comp-with-proj><span greeting="Hello world!"></span></comp-with-proj>'
})
export class ProjectingComp {
}

View File

@ -13,11 +13,8 @@ import {Component, Directive, QueryList, ViewChild, ViewChildren} from '@angular
export class CompForChildQuery {
}
@Component({
selector: 'comp-with-child-query',
template: '<comp-for-child-query></comp-for-child-query>',
directives: [CompForChildQuery]
})
@Component(
{selector: 'comp-with-child-query', template: '<comp-for-child-query></comp-for-child-query>'})
export class CompWithChildQuery {
@ViewChild(CompForChildQuery) child: CompForChildQuery;
@ViewChildren(CompForChildQuery) children: QueryList<CompForChildQuery>;
@ -29,7 +26,6 @@ export class DirectiveForQuery {
@Component({
selector: 'comp-with-directive-child',
directives: [DirectiveForQuery, NgFor],
template: `<div>
<div *ngFor="let data of divData" directive-for-query>{{data}}</div>
</div>`