本文整理汇总了TypeScript中@angular/core/testing.ComponentFixture.autoDetectChanges方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ComponentFixture.autoDetectChanges方法的具体用法?TypeScript ComponentFixture.autoDetectChanges怎么用?TypeScript ComponentFixture.autoDetectChanges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/core/testing.ComponentFixture
的用法示例。
在下文中一共展示了ComponentFixture.autoDetectChanges方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: beforeEach
beforeEach(async(() => {
routeParamsSubject.next({
id: '404',
resource: 'entities',
});
fixture.autoDetectChanges();
}));
示例2: beforeEach
beforeEach(() => {
fixture = TestBed.createComponent(HeroDetailComponent);
component = fixture.componentInstance;
el = fixture.debugElement;
fixture.autoDetectChanges();
});
示例3: beforeEach
beforeEach(async(() => {
const searchbar: NgorDatagridSearchComponent = fixture.debugElement
.query(By.directive(NgorDatagridSearchComponent)).componentInstance;
searchbar.searchFormGroup.controls.search.setValue('404');
searchbar.doSearch();
fixture.autoDetectChanges();
}));
示例4: beforeEach
beforeEach(async(() => TestUtils.beforeEachCompiler([ClickerForm]).then(compiled => {
fixture = compiled.fixture;
instance = compiled.instance;
instance.clicker = { name: 'TEST CLICKER' };
instance.clicker.getCount = function(): number { return 10; };
fixture.autoDetectChanges(true);
})));
示例5: beforeEach
beforeEach(() => {
fixture = TestBed.createComponent(DashboardComponent);
component = fixture.componentInstance;
el = fixture.debugElement.nativeElement;
fixture.autoDetectChanges();
});
示例6: initTest
export function initTest(testCpt: any, tpl: string): {fixture: ComponentFixture<any>, rootRenderer: ReactNativeRootRenderer} {
TestBed.overrideComponent(testCpt, {set: {template: tpl}});
const rootRenderer: ReactNativeRootRenderer = getTestBed().get(ReactNativeRootRenderer);
rootRenderer.zone = getTestBed().get(NgZone);
const fixture: ComponentFixture<any> = TestBed.createComponent(testCpt);
fixture.autoDetectChanges();
rootRenderer.executeCommands();
return {fixture: fixture, rootRenderer: rootRenderer};
}