test(ivy): enable ivy tests for platform-browser/animations (#27478)
PR Close #27478
This commit is contained in:
parent
8973dd5a7e
commit
b82f62a11d
@ -5,7 +5,7 @@
|
|||||||
* Use of this source code is governed by an MIT-style license that can be
|
* Use of this source code is governed by an MIT-style license that can be
|
||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
import {AnimationBuilder, AnimationFactory, AnimationMetadata, AnimationOptions, AnimationPlayer, NoopAnimationPlayer, sequence} from '@angular/animations';
|
import {AnimationBuilder, AnimationFactory, AnimationMetadata, AnimationOptions, AnimationPlayer, sequence} from '@angular/animations';
|
||||||
import {Inject, Injectable, RendererFactory2, RendererType2, ViewEncapsulation} from '@angular/core';
|
import {Inject, Injectable, RendererFactory2, RendererType2, ViewEncapsulation} from '@angular/core';
|
||||||
import {DOCUMENT} from '@angular/platform-browser';
|
import {DOCUMENT} from '@angular/platform-browser';
|
||||||
|
|
||||||
|
@ -7,3 +7,4 @@
|
|||||||
*/
|
*/
|
||||||
export {BrowserAnimationBuilder as ɵBrowserAnimationBuilder, BrowserAnimationFactory as ɵBrowserAnimationFactory} from './animation_builder';
|
export {BrowserAnimationBuilder as ɵBrowserAnimationBuilder, BrowserAnimationFactory as ɵBrowserAnimationFactory} from './animation_builder';
|
||||||
export {AnimationRenderer as ɵAnimationRenderer, AnimationRendererFactory as ɵAnimationRendererFactory} from './animation_renderer';
|
export {AnimationRenderer as ɵAnimationRenderer, AnimationRendererFactory as ɵAnimationRendererFactory} from './animation_renderer';
|
||||||
|
export {InjectableAnimationEngine as ɵInjectableAnimationEngine} from './providers';
|
||||||
|
@ -17,6 +17,7 @@ ts_library(
|
|||||||
"//packages/platform-browser-dynamic",
|
"//packages/platform-browser-dynamic",
|
||||||
"//packages/platform-browser/animations",
|
"//packages/platform-browser/animations",
|
||||||
"//packages/platform-browser/testing",
|
"//packages/platform-browser/testing",
|
||||||
|
"//packages/private/testing",
|
||||||
"@rxjs",
|
"@rxjs",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@ -24,9 +25,6 @@ ts_library(
|
|||||||
jasmine_node_test(
|
jasmine_node_test(
|
||||||
name = "test",
|
name = "test",
|
||||||
bootstrap = ["angular/tools/testing/init_node_spec.js"],
|
bootstrap = ["angular/tools/testing/init_node_spec.js"],
|
||||||
tags = [
|
|
||||||
"fixme-ivy-aot",
|
|
||||||
],
|
|
||||||
deps = [
|
deps = [
|
||||||
":test_lib",
|
":test_lib",
|
||||||
"//tools/testing:node",
|
"//tools/testing:node",
|
||||||
@ -35,9 +33,6 @@ jasmine_node_test(
|
|||||||
|
|
||||||
ts_web_test_suite(
|
ts_web_test_suite(
|
||||||
name = "test_web",
|
name = "test_web",
|
||||||
tags = [
|
|
||||||
"fixme-ivy-aot",
|
|
||||||
],
|
|
||||||
deps = [
|
deps = [
|
||||||
":test_lib",
|
":test_lib",
|
||||||
],
|
],
|
||||||
|
@ -9,11 +9,11 @@ import {AnimationPlayer, AnimationTriggerMetadata, animate, state, style, transi
|
|||||||
import {ɵAnimationEngine as AnimationEngine} from '@angular/animations/browser';
|
import {ɵAnimationEngine as AnimationEngine} from '@angular/animations/browser';
|
||||||
import {Component, Injectable, NgZone, RendererFactory2, RendererType2, ViewChild} from '@angular/core';
|
import {Component, Injectable, NgZone, RendererFactory2, RendererType2, ViewChild} from '@angular/core';
|
||||||
import {TestBed} from '@angular/core/testing';
|
import {TestBed} from '@angular/core/testing';
|
||||||
import {BrowserAnimationsModule, ɵAnimationRendererFactory as AnimationRendererFactory} from '@angular/platform-browser/animations';
|
import {BrowserAnimationsModule, ɵAnimationRendererFactory as AnimationRendererFactory, ɵInjectableAnimationEngine as InjectableAnimationEngine} from '@angular/platform-browser/animations';
|
||||||
import {DomRendererFactory2} from '@angular/platform-browser/src/dom/dom_renderer';
|
import {DomRendererFactory2} from '@angular/platform-browser/src/dom/dom_renderer';
|
||||||
|
import {fixmeIvy} from '@angular/private/testing';
|
||||||
|
|
||||||
import {el} from '../../testing/src/browser_util';
|
import {el} from '../../testing/src/browser_util';
|
||||||
import {InjectableAnimationEngine} from '../src/providers';
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
if (isNode) return;
|
if (isNode) return;
|
||||||
@ -120,6 +120,8 @@ import {InjectableAnimationEngine} from '../src/providers';
|
|||||||
// these tests are only mean't to be run within the DOM
|
// these tests are only mean't to be run within the DOM
|
||||||
if (isNode) return;
|
if (isNode) return;
|
||||||
|
|
||||||
|
fixmeIvy(
|
||||||
|
`FW-643: Components with animations throw with "Failed to execute 'setAttribute' on 'Element'`) &&
|
||||||
it('should flush and fire callbacks when the zone becomes stable', (async) => {
|
it('should flush and fire callbacks when the zone becomes stable', (async) => {
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-cmp',
|
selector: 'my-cmp',
|
||||||
@ -195,6 +197,8 @@ import {InjectableAnimationEngine} from '../src/providers';
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
fixmeIvy(
|
||||||
|
`FW-643: Components with animations throw with "Failed to execute 'setAttribute' on 'Element'`) &&
|
||||||
it('should only queue up dom removals if the element itself contains a valid leave animation',
|
it('should only queue up dom removals if the element itself contains a valid leave animation',
|
||||||
() => {
|
() => {
|
||||||
@Component({
|
@Component({
|
||||||
@ -279,6 +283,8 @@ import {InjectableAnimationEngine} from '../src/providers';
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
fixmeIvy(
|
||||||
|
`FW-643: Components with animations throw with "Failed to execute 'setAttribute' on 'Element'`) &&
|
||||||
it('should provide hooks at the start and end of change detection', () => {
|
it('should provide hooks at the start and end of change detection', () => {
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-cmp',
|
selector: 'my-cmp',
|
||||||
|
@ -10,10 +10,9 @@ import {AnimationDriver} from '@angular/animations/browser';
|
|||||||
import {MockAnimationDriver} from '@angular/animations/browser/testing';
|
import {MockAnimationDriver} from '@angular/animations/browser/testing';
|
||||||
import {Component, ViewChild} from '@angular/core';
|
import {Component, ViewChild} from '@angular/core';
|
||||||
import {TestBed, fakeAsync, flushMicrotasks} from '@angular/core/testing';
|
import {TestBed, fakeAsync, flushMicrotasks} from '@angular/core/testing';
|
||||||
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
|
import {NoopAnimationsModule, ɵBrowserAnimationBuilder as BrowserAnimationBuilder} from '@angular/platform-browser/animations';
|
||||||
|
|
||||||
import {el} from '../../testing/src/browser_util';
|
import {el} from '../../testing/src/browser_util';
|
||||||
import {BrowserAnimationBuilder} from '../src/animation_builder';
|
|
||||||
|
|
||||||
{
|
{
|
||||||
describe('BrowserAnimationBuilder', () => {
|
describe('BrowserAnimationBuilder', () => {
|
||||||
|
@ -9,13 +9,18 @@ import {animate, style, transition, trigger} from '@angular/animations';
|
|||||||
import {ɵAnimationEngine} from '@angular/animations/browser';
|
import {ɵAnimationEngine} from '@angular/animations/browser';
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {TestBed} from '@angular/core/testing';
|
import {TestBed} from '@angular/core/testing';
|
||||||
|
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
|
||||||
import {NoopAnimationsModule} from '../src/module';
|
import {fixmeIvy} from '@angular/private/testing';
|
||||||
|
|
||||||
{
|
{
|
||||||
describe('NoopAnimationsModule', () => {
|
describe('NoopAnimationsModule', () => {
|
||||||
beforeEach(() => { TestBed.configureTestingModule({imports: [NoopAnimationsModule]}); });
|
beforeEach(() => { TestBed.configureTestingModule({imports: [NoopAnimationsModule]}); });
|
||||||
|
|
||||||
|
it('should be removed once FW-643 is fixed', () => { expect(true).toBeTruthy(); });
|
||||||
|
|
||||||
|
// TODO: remove the dummy test above ^ once the bug FW-643 has been fixed
|
||||||
|
fixmeIvy(
|
||||||
|
`FW-643: Components with animations throw with "Failed to execute 'setAttribute' on 'Element'`) &&
|
||||||
it('should flush and fire callbacks when the zone becomes stable', (async) => {
|
it('should flush and fire callbacks when the zone becomes stable', (async) => {
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-cmp',
|
selector: 'my-cmp',
|
||||||
@ -24,7 +29,8 @@ import {NoopAnimationsModule} from '../src/module';
|
|||||||
animations: [trigger(
|
animations: [trigger(
|
||||||
'myAnimation',
|
'myAnimation',
|
||||||
[transition(
|
[transition(
|
||||||
'* => state', [style({'opacity': '0'}), animate(500, style({'opacity': '1'}))])])],
|
'* => state',
|
||||||
|
[style({'opacity': '0'}), animate(500, style({'opacity': '1'}))])])],
|
||||||
})
|
})
|
||||||
class Cmp {
|
class Cmp {
|
||||||
exp: any;
|
exp: any;
|
||||||
@ -49,6 +55,8 @@ import {NoopAnimationsModule} from '../src/module';
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
fixmeIvy(
|
||||||
|
`FW-643: Components with animations throw with "Failed to execute 'setAttribute' on 'Element'`) &&
|
||||||
it('should handle leave animation callbacks even if the element is destroyed in the process',
|
it('should handle leave animation callbacks even if the element is destroyed in the process',
|
||||||
(async) => {
|
(async) => {
|
||||||
@Component({
|
@Component({
|
||||||
@ -58,7 +66,8 @@ import {NoopAnimationsModule} from '../src/module';
|
|||||||
animations: [trigger(
|
animations: [trigger(
|
||||||
'myAnimation',
|
'myAnimation',
|
||||||
[transition(
|
[transition(
|
||||||
':leave', [style({'opacity': '0'}), animate(500, style({'opacity': '1'}))])])],
|
':leave',
|
||||||
|
[style({'opacity': '0'}), animate(500, style({'opacity': '1'}))])])],
|
||||||
})
|
})
|
||||||
class Cmp {
|
class Cmp {
|
||||||
exp: any;
|
exp: any;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user