test(ivy): update root causes for @angular/core TestBed failures (#27602)
PR Close #27602
This commit is contained in:
parent
452668b581
commit
6980631631
@ -537,8 +537,8 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
|||||||
expect(renderLog.log).toEqual(['someProp=Megatron']);
|
expect(renderLog.log).toEqual(['someProp=Megatron']);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
fixmeIvy('unknown').it(
|
fixmeIvy('FW-820: Pipes returning WrappedValue corrupt unrelated bindings ')
|
||||||
'should record unwrapped values via ngOnChanges', fakeAsync(() => {
|
.it('should record unwrapped values via ngOnChanges', fakeAsync(() => {
|
||||||
const ctx = createCompFixture(
|
const ctx = createCompFixture(
|
||||||
'<div [testDirective]="\'aName\' | wrappedPipe" [a]="1" [b]="2 | wrappedPipe"></div>');
|
'<div [testDirective]="\'aName\' | wrappedPipe" [a]="1" [b]="2 | wrappedPipe"></div>');
|
||||||
const dir: TestDirective = queryDirs(ctx.debugElement, TestDirective)[0];
|
const dir: TestDirective = queryDirs(ctx.debugElement, TestDirective)[0];
|
||||||
@ -589,8 +589,8 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
|||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
fixmeIvy('unknown').it(
|
fixmeIvy('FW-821: Pure pipes are instantiated differently in view engine and ivy')
|
||||||
'should call pure pipes that are used multiple times only when the arguments change',
|
.it('should call pure pipes that are used multiple times only when the arguments change',
|
||||||
fakeAsync(() => {
|
fakeAsync(() => {
|
||||||
const ctx = createCompFixture(
|
const ctx = createCompFixture(
|
||||||
`<div [someProp]="name | countingPipe"></div><div [someProp]="age | countingPipe"></div>` +
|
`<div [someProp]="name | countingPipe"></div><div [someProp]="age | countingPipe"></div>` +
|
||||||
@ -1076,8 +1076,8 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('ngOnDestroy', () => {
|
describe('ngOnDestroy', () => {
|
||||||
fixmeIvy('unknown').it(
|
fixmeIvy('FW-763: LView tree not properly constructed / destroyed')
|
||||||
'should be called on view destruction', fakeAsync(() => {
|
.it('should be called on view destruction', fakeAsync(() => {
|
||||||
const ctx = createCompFixture('<div testDirective="dir"></div>');
|
const ctx = createCompFixture('<div testDirective="dir"></div>');
|
||||||
ctx.detectChanges(false);
|
ctx.detectChanges(false);
|
||||||
|
|
||||||
@ -1086,11 +1086,13 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
|||||||
expect(directiveLog.filter(['ngOnDestroy'])).toEqual(['dir.ngOnDestroy']);
|
expect(directiveLog.filter(['ngOnDestroy'])).toEqual(['dir.ngOnDestroy']);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
fixmeIvy('unknown').it(
|
fixmeIvy('FW-763: LView tree not properly constructed / destroyed')
|
||||||
'should be called after processing the content and view children', fakeAsync(() => {
|
.it('should be called after processing the content and view children', fakeAsync(() => {
|
||||||
TestBed.overrideComponent(AnotherComponent, {
|
TestBed.overrideComponent(AnotherComponent, {
|
||||||
set: new Component(
|
set: new Component({
|
||||||
{selector: 'other-cmp', template: '<div testDirective="viewChild"></div>'})
|
selector: 'other-cmp',
|
||||||
|
template: '<div testDirective="viewChild"></div>'
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
const ctx = createCompFixture(
|
const ctx = createCompFixture(
|
||||||
@ -1102,13 +1104,13 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
|||||||
ctx.destroy();
|
ctx.destroy();
|
||||||
|
|
||||||
expect(directiveLog.filter(['ngOnDestroy'])).toEqual([
|
expect(directiveLog.filter(['ngOnDestroy'])).toEqual([
|
||||||
'contentChild0.ngOnDestroy', 'contentChild1.ngOnDestroy', 'viewChild.ngOnDestroy',
|
'contentChild0.ngOnDestroy', 'contentChild1.ngOnDestroy',
|
||||||
'parent.ngOnDestroy'
|
'viewChild.ngOnDestroy', 'parent.ngOnDestroy'
|
||||||
]);
|
]);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
fixmeIvy('unknown').it(
|
fixmeIvy('FW-763: LView tree not properly constructed / destroyed')
|
||||||
'should be called in reverse order so the child is always notified before the parent',
|
.it('should be called in reverse order so the child is always notified before the parent',
|
||||||
fakeAsync(() => {
|
fakeAsync(() => {
|
||||||
const ctx = createCompFixture(
|
const ctx = createCompFixture(
|
||||||
'<div testDirective="parent"><div testDirective="child"></div></div><div testDirective="sibling"></div>');
|
'<div testDirective="parent"><div testDirective="child"></div></div><div testDirective="sibling"></div>');
|
||||||
@ -1121,9 +1123,10 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
|||||||
]);
|
]);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
fixmeIvy('unknown').it(
|
fixmeIvy('FW-763: LView tree not properly constructed / destroyed')
|
||||||
'should deliver synchronous events to parent', fakeAsync(() => {
|
.it('should deliver synchronous events to parent', fakeAsync(() => {
|
||||||
const ctx = createCompFixture('<div (destroy)="a=$event" onDestroyDirective></div>');
|
const ctx =
|
||||||
|
createCompFixture('<div (destroy)="a=$event" onDestroyDirective></div>');
|
||||||
|
|
||||||
ctx.detectChanges(false);
|
ctx.detectChanges(false);
|
||||||
ctx.destroy();
|
ctx.destroy();
|
||||||
@ -1131,7 +1134,8 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
|||||||
expect(ctx.componentInstance.a).toEqual('destroyed');
|
expect(ctx.componentInstance.a).toEqual('destroyed');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
fixmeIvy('unknown').it('should call ngOnDestroy on pipes', fakeAsync(() => {
|
fixmeIvy('FW-763: LView tree not properly constructed / destroyed')
|
||||||
|
.it('should call ngOnDestroy on pipes', fakeAsync(() => {
|
||||||
const ctx = createCompFixture('{{true | pipeWithOnDestroy }}');
|
const ctx = createCompFixture('{{true | pipeWithOnDestroy }}');
|
||||||
|
|
||||||
ctx.detectChanges(false);
|
ctx.detectChanges(false);
|
||||||
@ -1142,12 +1146,12 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
|||||||
]);
|
]);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
fixmeIvy('unknown').it('should call ngOnDestroy on an injectable class', fakeAsync(() => {
|
fixmeIvy('FW-763: LView tree not properly constructed / destroyed')
|
||||||
|
.it('should call ngOnDestroy on an injectable class', fakeAsync(() => {
|
||||||
TestBed.overrideDirective(
|
TestBed.overrideDirective(
|
||||||
TestDirective, {set: {providers: [InjectableWithLifecycle]}});
|
TestDirective, {set: {providers: [InjectableWithLifecycle]}});
|
||||||
|
|
||||||
const ctx = createCompFixture(
|
const ctx = createCompFixture('<div testDirective="dir"></div>', TestComponent);
|
||||||
'<div testDirective="dir"></div>', TestComponent);
|
|
||||||
|
|
||||||
ctx.debugElement.children[0].injector.get(InjectableWithLifecycle);
|
ctx.debugElement.children[0].injector.get(InjectableWithLifecycle);
|
||||||
ctx.detectChanges(false);
|
ctx.detectChanges(false);
|
||||||
@ -1163,8 +1167,8 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('enforce no new changes', () => {
|
describe('enforce no new changes', () => {
|
||||||
fixmeIvy('unknown').it(
|
fixmeIvy('FW-823: ComponentFixture.checkNoChanges doesn\'t throw under TestBed')
|
||||||
'should throw when a record gets changed after it has been checked', fakeAsync(() => {
|
.it('should throw when a record gets changed after it has been checked', fakeAsync(() => {
|
||||||
@Directive({selector: '[changed]'})
|
@Directive({selector: '[changed]'})
|
||||||
class ChangingDirective {
|
class ChangingDirective {
|
||||||
@Input() changed: any;
|
@Input() changed: any;
|
||||||
@ -1198,7 +1202,8 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
|||||||
expect(() => ctx.checkNoChanges()).not.toThrow();
|
expect(() => ctx.checkNoChanges()).not.toThrow();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
fixmeIvy('unknown').it('should not break the next run', fakeAsync(() => {
|
fixmeIvy('FW-823: ComponentFixture.checkNoChanges doesn\'t throw under TestBed')
|
||||||
|
.it('should not break the next run', fakeAsync(() => {
|
||||||
const ctx = _bindSimpleValue('a', TestData);
|
const ctx = _bindSimpleValue('a', TestData);
|
||||||
ctx.componentInstance.a = 'value';
|
ctx.componentInstance.a = 'value';
|
||||||
expect(() => ctx.checkNoChanges()).toThrow();
|
expect(() => ctx.checkNoChanges()).toThrow();
|
||||||
@ -1271,7 +1276,9 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
|||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
fixmeIvy('unknown').it('Reattaches in the original cd mode', fakeAsync(() => {
|
fixmeIvy(
|
||||||
|
'FW-764: fixture.detectChanges() is not respecting OnPush flag on components in the root template')
|
||||||
|
.it('Reattaches in the original cd mode', fakeAsync(() => {
|
||||||
const ctx = createCompFixture('<push-cmp></push-cmp>');
|
const ctx = createCompFixture('<push-cmp></push-cmp>');
|
||||||
const cmp: PushComp = queryDirs(ctx.debugElement, PushComp)[0];
|
const cmp: PushComp = queryDirs(ctx.debugElement, PushComp)[0];
|
||||||
cmp.changeDetectorRef.detach();
|
cmp.changeDetectorRef.detach();
|
||||||
@ -1291,10 +1298,10 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('multi directive order', () => {
|
describe('multi directive order', () => {
|
||||||
fixmeIvy('unknown').it(
|
fixmeIvy('FW-822: Order of bindings to directive inputs different in ivy')
|
||||||
'should follow the DI order for the same element', fakeAsync(() => {
|
.it('should follow the DI order for the same element', fakeAsync(() => {
|
||||||
const ctx =
|
const ctx = createCompFixture(
|
||||||
createCompFixture('<div orderCheck2="2" orderCheck0="0" orderCheck1="1"></div>');
|
'<div orderCheck2="2" orderCheck0="0" orderCheck1="1"></div>');
|
||||||
|
|
||||||
ctx.detectChanges(false);
|
ctx.detectChanges(false);
|
||||||
ctx.destroy();
|
ctx.destroy();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user