test(ivy): update root causes for animation tests (#28091)
PR Close #28091
This commit is contained in:
parent
2afbcafab7
commit
133fe5e561
|
@ -3375,8 +3375,8 @@ const DEFAULT_COMPONENT_ID = '1';
|
||||||
expect(getLog().length).toEqual(1);
|
expect(getLog().length).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
fixmeIvy('unknown').it(
|
fixmeIvy('FW-951 - Attribute-only synthetic properties are treated differently in Ivy')
|
||||||
'should treat the property as true when the expression is missing', () => {
|
.it('should treat the property as true when the expression is missing', () => {
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'parent-cmp',
|
selector: 'parent-cmp',
|
||||||
animations: [
|
animations: [
|
||||||
|
@ -3674,19 +3674,19 @@ const DEFAULT_COMPONENT_ID = '1';
|
||||||
expect(() => { TestBed.createComponent(Cmp); }).not.toThrowError();
|
expect(() => { TestBed.createComponent(Cmp); }).not.toThrowError();
|
||||||
});
|
});
|
||||||
|
|
||||||
fixmeIvy('unknown').it(
|
fixmeIvy('FW-952 - Error recovery is handled differently in Ivy than VE')
|
||||||
'should continue to clean up DOM-related animation artificats even if a compiler-level error is thrown midway',
|
.it('should continue to clean up DOM-related animation artificats even if a compiler-level error is thrown midway',
|
||||||
() => {
|
() => {
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'if-cmp',
|
selector: 'if-cmp',
|
||||||
animations: [
|
animations: [
|
||||||
trigger(
|
trigger(
|
||||||
'foo',
|
'foo',
|
||||||
[
|
[
|
||||||
transition('* => something', []),
|
transition('* => something', []),
|
||||||
]),
|
]),
|
||||||
],
|
],
|
||||||
template: `
|
template: `
|
||||||
value = {{ foo[bar] }}
|
value = {{ foo[bar] }}
|
||||||
<div #contents>
|
<div #contents>
|
||||||
<div *ngIf="exp">1</div>
|
<div *ngIf="exp">1</div>
|
||||||
|
@ -3694,32 +3694,32 @@ const DEFAULT_COMPONENT_ID = '1';
|
||||||
<div *ngIf="exp" [@foo]="'123'">3</div>
|
<div *ngIf="exp" [@foo]="'123'">3</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
})
|
})
|
||||||
class Cmp {
|
class Cmp {
|
||||||
exp: any = false;
|
exp: any = false;
|
||||||
|
|
||||||
@ViewChild('contents') public contents: any;
|
@ViewChild('contents') public contents: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
TestBed.configureTestingModule({declarations: [Cmp]});
|
TestBed.configureTestingModule({declarations: [Cmp]});
|
||||||
|
|
||||||
const engine = TestBed.get(ɵAnimationEngine);
|
const engine = TestBed.get(ɵAnimationEngine);
|
||||||
const fixture = TestBed.createComponent(Cmp);
|
const fixture = TestBed.createComponent(Cmp);
|
||||||
|
|
||||||
const runCD = () => fixture.detectChanges();
|
const runCD = () => fixture.detectChanges();
|
||||||
const cmp = fixture.componentInstance;
|
const cmp = fixture.componentInstance;
|
||||||
|
|
||||||
cmp.exp = true;
|
cmp.exp = true;
|
||||||
expect(runCD).toThrow();
|
expect(runCD).toThrow();
|
||||||
|
|
||||||
const contents = cmp.contents.nativeElement;
|
const contents = cmp.contents.nativeElement;
|
||||||
expect(contents.innerText.replace(/\s+/gm, '')).toEqual('123');
|
expect(contents.innerText.replace(/\s+/gm, '')).toEqual('123');
|
||||||
|
|
||||||
cmp.exp = false;
|
cmp.exp = false;
|
||||||
expect(runCD).toThrow();
|
expect(runCD).toThrow();
|
||||||
|
|
||||||
expect(contents.innerText.trim()).toEqual('');
|
expect(contents.innerText.trim()).toEqual('');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('errors for not using the animation module', () => {
|
describe('errors for not using the animation module', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
Loading…
Reference in New Issue