test(ivy): update root causes for @angular/core TestBed failures (#27479)

PR Close #27479
This commit is contained in:
Pawel Kozlowski
2018-12-05 15:52:35 +01:00
committed by Igor Minar
parent 26433509f9
commit 821fecb413
6 changed files with 755 additions and 734 deletions

View File

@ -625,23 +625,22 @@ function declareTests(config?: {useJit: boolean}) {
});
if (getDOM().supportsDOMEvents()) {
fixmeIvy('unknown').it(
'should allow to destroy a component from within a host event handler',
fakeAsync(() => {
TestBed.configureTestingModule({declarations: [MyComp, [[PushCmpWithHostEvent]]]});
const template = '<push-cmp-with-host-event></push-cmp-with-host-event>';
TestBed.overrideComponent(MyComp, {set: {template}});
const fixture = TestBed.createComponent(MyComp);
it('should allow to destroy a component from within a host event handler',
fakeAsync(() => {
TestBed.configureTestingModule({declarations: [MyComp, [[PushCmpWithHostEvent]]]});
const template = '<push-cmp-with-host-event></push-cmp-with-host-event>';
TestBed.overrideComponent(MyComp, {set: {template}});
const fixture = TestBed.createComponent(MyComp);
tick();
fixture.detectChanges();
tick();
fixture.detectChanges();
const cmpEl = fixture.debugElement.children[0];
const cmp: PushCmpWithHostEvent = cmpEl.injector.get(PushCmpWithHostEvent);
cmp.ctxCallback = (_: any) => fixture.destroy();
const cmpEl = fixture.debugElement.children[0];
const cmp: PushCmpWithHostEvent = cmpEl.injector.get(PushCmpWithHostEvent);
cmp.ctxCallback = (_: any) => fixture.destroy();
expect(() => cmpEl.triggerEventHandler('click', <Event>{})).not.toThrow();
}));
expect(() => cmpEl.triggerEventHandler('click', <Event>{})).not.toThrow();
}));
}
fixmeIvy('FW-758: OnPush events not marking view dirty when using renderer2')