Revert "test(ivy): re-enable passing animation tests (#27997)"

This reverts commit 097af5ae2b75b6040d22348d75e2923fa6ada8ec.
It was accidentally merged on both master and patch branches when
it should have only been merged on master.
This commit is contained in:
Kara Erickson 2019-01-08 16:19:44 -08:00
parent e1538fdd63
commit 5a7dd73b2c

View File

@ -824,40 +824,43 @@ const DEFAULT_COMPONENT_ID = '1';
}); });
describe('host bindings', () => { describe('host bindings', () => {
it('should trigger a state change animation from state => state on the component host element', fixmeIvy('unknown').it(
fakeAsync(() => { 'should trigger a state change animation from state => state on the component host element',
@Component({ fakeAsync(() => {
selector: 'my-cmp', @Component({
template: '...', selector: 'my-cmp',
animations: [trigger( template: '...',
'myAnimation', animations: [trigger(
[transition( 'myAnimation',
'a => b', [transition(
[style({'opacity': '0'}), animate(500, style({'opacity': '1'}))])])], 'a => b',
}) [style({'opacity': '0'}), animate(500, style({'opacity': '1'}))])])],
class Cmp { })
@HostBinding('@myAnimation') class Cmp {
exp = 'a'; @HostBinding('@myAnimation')
} exp = 'a';
}
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 cmp = fixture.componentInstance; const cmp = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
engine.flush(); engine.flush();
expect(getLog().length).toEqual(0); expect(getLog().length).toEqual(0);
cmp.exp = 'b'; cmp.exp = 'b';
fixture.detectChanges(); fixture.detectChanges();
engine.flush(); engine.flush();
expect(getLog().length).toEqual(1); expect(getLog().length).toEqual(1);
const data = getLog().pop() !; const data = getLog().pop() !;
expect(data.element).toEqual(fixture.elementRef.nativeElement); expect(data.element).toEqual(fixture.elementRef.nativeElement);
expect(data.keyframes).toEqual([{offset: 0, opacity: '0'}, {offset: 1, opacity: '1'}]); expect(data.keyframes).toEqual([
})); {offset: 0, opacity: '0'}, {offset: 1, opacity: '1'}
]);
}));
// nonAnimationRenderer => animationRenderer // nonAnimationRenderer => animationRenderer
fixmeIvy('unknown').it( fixmeIvy('unknown').it(
@ -2725,43 +2728,44 @@ const DEFAULT_COMPONENT_ID = '1';
expect(elm.innerText.trim()).toEqual(''); expect(elm.innerText.trim()).toEqual('');
})); }));
it('should trigger a state change listener for when the animation changes state from void => state on the host element', fixmeIvy('unknown').it(
fakeAsync(() => { 'should trigger a state change listener for when the animation changes state from void => state on the host element',
@Component({ fakeAsync(() => {
selector: 'my-cmp', @Component({
template: `...`, selector: 'my-cmp',
animations: [trigger( template: `...`,
'myAnimation2', animations: [trigger(
[transition( 'myAnimation2',
'void => *', [transition(
[style({'opacity': '0'}), animate(1000, style({'opacity': '1'}))])])], 'void => *',
}) [style({'opacity': '0'}), animate(1000, style({'opacity': '1'}))])])],
class Cmp { })
// TODO(issue/24571): remove '!'. class Cmp {
event !: AnimationEvent; // TODO(issue/24571): remove '!'.
event !: AnimationEvent;
@HostBinding('@myAnimation2') @HostBinding('@myAnimation2')
exp: any = false; exp: any = false;
@HostListener('@myAnimation2.start', ['$event']) @HostListener('@myAnimation2.start', ['$event'])
callback = (event: any) => { this.event = event; } callback = (event: any) => { this.event = event; }
} }
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 cmp = fixture.componentInstance; const cmp = fixture.componentInstance;
cmp.exp = 'TRUE'; cmp.exp = 'TRUE';
fixture.detectChanges(); fixture.detectChanges();
flushMicrotasks(); flushMicrotasks();
expect(cmp.event.triggerName).toEqual('myAnimation2'); expect(cmp.event.triggerName).toEqual('myAnimation2');
expect(cmp.event.phaseName).toEqual('start'); expect(cmp.event.phaseName).toEqual('start');
expect(cmp.event.totalTime).toEqual(1000); expect(cmp.event.totalTime).toEqual(1000);
expect(cmp.event.fromState).toEqual('void'); expect(cmp.event.fromState).toEqual('void');
expect(cmp.event.toState).toEqual('TRUE'); expect(cmp.event.toState).toEqual('TRUE');
})); }));
fixmeIvy('unknown').it( fixmeIvy('unknown').it(
'should always fire callbacks even when a transition is not detected', fakeAsync(() => { 'should always fire callbacks even when a transition is not detected', fakeAsync(() => {