test(core): update core tests (unrelated to queries) to use static flag (#30626)

PR Close #30626
This commit is contained in:
Kara Erickson
2019-05-22 17:15:41 -07:00
committed by Jason Aden
parent 21e8ac1e02
commit 4299ecf9be
24 changed files with 185 additions and 203 deletions

View File

@ -16,7 +16,6 @@ import {BrowserModule} from '@angular/platform-browser';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {dispatchEvent} from '@angular/platform-browser/testing/src/browser_util';
import {expect} from '@angular/platform-browser/testing/src/matchers';
import {ivyEnabled} from '@angular/private/testing';
import {NoopNgZone} from '../src/zone/ng_zone';
import {ComponentFixtureNoNgZone, TestBed, async, inject, withModule} from '../testing';
@ -386,14 +385,14 @@ class SomeComponent {
@Component({template: '<ng-container #vc></ng-container>'})
class ContainerComp {
// TODO(issue/24571): remove '!'.
@ViewChild('vc', {read: ViewContainerRef})
@ViewChild('vc', {read: ViewContainerRef, static: false})
vc !: ViewContainerRef;
}
@Component({template: '<ng-template #t>Dynamic content</ng-template>'})
class EmbeddedViewComp {
// TODO(issue/24571): remove '!'.
@ViewChild(TemplateRef)
@ViewChild(TemplateRef, {static: true})
tplRef !: TemplateRef<Object>;
}
@ -447,10 +446,6 @@ class SomeComponent {
const comp = TestBed.createComponent(EmbeddedViewComp);
const appRef: ApplicationRef = TestBed.get(ApplicationRef);
// In Ivy, change detection needs to run before the ViewQuery for tplRef will resolve.
// Keeping this test enabled since we still want to test this destroy logic in Ivy.
if (ivyEnabled) comp.detectChanges();
const embeddedViewRef = comp.componentInstance.tplRef.createEmbeddedView({});
appRef.attachView(embeddedViewRef);