refactor(test): <template>/<ng-container>/*-directives

- remove outer `<div>` in tests,
- use `<ng-container>` instead of `<template>` where possible,
- use *... instead of template (tag or attr) where possible.

Fixes #13816
This commit is contained in:
Victor Berchet
2017-01-06 14:18:17 -08:00
committed by Matias Niemelä
parent d7f2a3c71b
commit 4b56f79328
9 changed files with 147 additions and 242 deletions

View File

@ -138,7 +138,7 @@ export function main() {
@Component({
selector: 'child',
template:
'(<template [ngTemplateOutlet]="templateRef" [ngOutletContext]="templateCtx"></template>)'
'(<ng-container [ngTemplateOutlet]="templateRef" [ngOutletContext]="templateCtx"></ng-container>)'
})
class Child {
@Input()

View File

@ -421,7 +421,7 @@ export function main() {
TestBed.overrideDirective(
SimpleDirective, {set: {providers: [{provide: 'service', useValue: 'parentService'}]}});
const el = createComponent(
'<div simpleDirective><template [ngIf]="true"><div *ngIf="true" needsService></div></template></div>');
'<div simpleDirective><ng-container *ngIf="true"><div *ngIf="true" needsService></div></ng-container></div>');
expect(el.children[0].children[0].injector.get(NeedsService).service)
.toEqual('parentService');
});