fix(ivy): don’t publish animation bindings as attributes (#27805)

Some of the animation tests have been failing because animation gets
triggered multiple times. The reason for this is that the compiler was
generating static attribute bindings in addition to dynamic bindings.
This created multiple writes to the animation render which failed the
tests.

PR Close #27805
This commit is contained in:
Misko Hevery
2018-12-21 11:53:18 -08:00
committed by Ben Lesh
parent 880b4aabdb
commit 1f1e77b641
9 changed files with 1151 additions and 1080 deletions

View File

@ -279,36 +279,35 @@ import {el} from '../../testing/src/browser_util';
});
});
fixmeIvy(`FW-802: Animation 'start' and 'end' hooks are invoked twice`)
.it('should provide hooks at the start and end of change detection', () => {
@Component({
selector: 'my-cmp',
template: `
it('should provide hooks at the start and end of change detection', () => {
@Component({
selector: 'my-cmp',
template: `
<div [@myAnimation]="exp"></div>
`,
animations: [trigger('myAnimation', [])]
})
class Cmp {
public exp: any;
}
animations: [trigger('myAnimation', [])]
})
class Cmp {
public exp: any;
}
TestBed.configureTestingModule({
providers: [{provide: AnimationEngine, useClass: InjectableAnimationEngine}],
declarations: [Cmp]
});
TestBed.configureTestingModule({
providers: [{provide: AnimationEngine, useClass: InjectableAnimationEngine}],
declarations: [Cmp]
});
const renderer = TestBed.get(RendererFactory2) as ExtendedAnimationRendererFactory;
const fixture = TestBed.createComponent(Cmp);
const cmp = fixture.componentInstance;
const renderer = TestBed.get(RendererFactory2) as ExtendedAnimationRendererFactory;
const fixture = TestBed.createComponent(Cmp);
const cmp = fixture.componentInstance;
renderer.log = [];
fixture.detectChanges();
expect(renderer.log).toEqual(['begin', 'end']);
renderer.log = [];
fixture.detectChanges();
expect(renderer.log).toEqual(['begin', 'end']);
renderer.log = [];
fixture.detectChanges();
expect(renderer.log).toEqual(['begin', 'end']);
});
renderer.log = [];
fixture.detectChanges();
expect(renderer.log).toEqual(['begin', 'end']);
});
});
})();