test(ivy): enable more of @angular/core tests on node and in a browser (#27572)
PR Close #27572
This commit is contained in:
parent
54e4bdb842
commit
2182be48c4
@ -66,8 +66,7 @@ const DEFAULT_COMPONENT_ID = '1';
|
||||
}
|
||||
|
||||
describe('fakeAsync testing', () => {
|
||||
fixmeIvy('unknown').it(
|
||||
'should only require one flushMicrotasks call to kick off animation callbacks',
|
||||
it('should only require one flushMicrotasks call to kick off animation callbacks',
|
||||
fakeAsync(() => {
|
||||
@Component({
|
||||
selector: 'cmp',
|
||||
@ -459,8 +458,7 @@ const DEFAULT_COMPONENT_ID = '1';
|
||||
expect(player.duration).toEqual(1234);
|
||||
});
|
||||
|
||||
fixmeIvy('unknown').it(
|
||||
'should always cancel the previous transition if a follow-up transition is not matched',
|
||||
it('should always cancel the previous transition if a follow-up transition is not matched',
|
||||
fakeAsync(() => {
|
||||
@Component({
|
||||
selector: 'if-cmp',
|
||||
@ -470,8 +468,7 @@ const DEFAULT_COMPONENT_ID = '1';
|
||||
animations: [trigger(
|
||||
'myAnimation',
|
||||
[transition(
|
||||
'a => b',
|
||||
[style({'opacity': '0'}), animate(500, style({'opacity': '1'}))])])],
|
||||
'a => b', [style({'opacity': '0'}), animate(500, style({'opacity': '1'}))])])],
|
||||
})
|
||||
class Cmp {
|
||||
exp: any;
|
||||
@ -540,8 +537,7 @@ const DEFAULT_COMPONENT_ID = '1';
|
||||
expect(completed).toBe(true);
|
||||
}));
|
||||
|
||||
fixmeIvy('unknown').it(
|
||||
'should always fire inner callbacks even if no animation is fired when a view is inserted',
|
||||
it('should always fire inner callbacks even if no animation is fired when a view is inserted',
|
||||
fakeAsync(() => {
|
||||
@Component({
|
||||
selector: 'if-cmp',
|
||||
@ -2546,8 +2542,7 @@ const DEFAULT_COMPONENT_ID = '1';
|
||||
expect(cmp.event.toState).toEqual('b');
|
||||
}));
|
||||
|
||||
fixmeIvy('unknown').it(
|
||||
'should handle callbacks for multiple triggers running simultaneously', fakeAsync(() => {
|
||||
it('should handle callbacks for multiple triggers running simultaneously', fakeAsync(() => {
|
||||
@Component({
|
||||
selector: 'if-cmp',
|
||||
template: `
|
||||
@ -2611,8 +2606,7 @@ const DEFAULT_COMPONENT_ID = '1';
|
||||
expect(cmp.event2.triggerName).toBeTruthy('ani2');
|
||||
}));
|
||||
|
||||
fixmeIvy('unknown').it(
|
||||
'should handle callbacks for multiple triggers running simultaneously on the same element',
|
||||
it('should handle callbacks for multiple triggers running simultaneously on the same element',
|
||||
fakeAsync(() => {
|
||||
@Component({
|
||||
selector: 'if-cmp',
|
||||
@ -2810,8 +2804,7 @@ const DEFAULT_COMPONENT_ID = '1';
|
||||
expect(cmp.log).toEqual(['start => b', 'done => b']);
|
||||
}));
|
||||
|
||||
fixmeIvy('unknown').it(
|
||||
'should fire callback events for leave animations even if there is no leave transition',
|
||||
it('should fire callback events for leave animations even if there is no leave transition',
|
||||
fakeAsync(() => {
|
||||
@Component({
|
||||
selector: 'my-cmp',
|
||||
@ -3285,8 +3278,7 @@ const DEFAULT_COMPONENT_ID = '1';
|
||||
expect(parent.childElementCount).toEqual(0);
|
||||
});
|
||||
|
||||
fixmeIvy('unknown').it(
|
||||
'should properly resolve animation event listeners when disabled', fakeAsync(() => {
|
||||
it('should properly resolve animation event listeners when disabled', fakeAsync(() => {
|
||||
@Component({
|
||||
selector: 'if-cmp',
|
||||
template: `
|
||||
@ -3429,8 +3421,7 @@ const DEFAULT_COMPONENT_ID = '1';
|
||||
expect(getLog().length).toEqual(0);
|
||||
});
|
||||
|
||||
fixmeIvy('unknown').it(
|
||||
'should respect parent/sub animations when the respective area in the DOM is disabled',
|
||||
it('should respect parent/sub animations when the respective area in the DOM is disabled',
|
||||
fakeAsync(() => {
|
||||
@Component({
|
||||
selector: 'parent-cmp',
|
||||
@ -3759,8 +3750,7 @@ const DEFAULT_COMPONENT_ID = '1';
|
||||
'Found the synthetic property @myAnimation. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.');
|
||||
});
|
||||
|
||||
fixmeIvy('unknown').it(
|
||||
'should throw when using an @prop listener without the animation module', () => {
|
||||
it('should throw when using an @prop listener without the animation module', () => {
|
||||
@Component({template: `<div (@myAnimation.start)="a = true"></div>`})
|
||||
class Cmp {
|
||||
a: any;
|
||||
|
@ -2635,8 +2635,7 @@ import {HostListener} from '../../src/metadata/directives';
|
||||
expect(p3.element.classList.contains('page2')).toBe(true);
|
||||
});
|
||||
|
||||
fixmeIvy('unknown').it(
|
||||
'should emulate leave animation callbacks for all sub elements that have leave triggers within the component',
|
||||
it('should emulate leave animation callbacks for all sub elements that have leave triggers within the component',
|
||||
fakeAsync(() => {
|
||||
@Component({
|
||||
selector: 'ani-cmp',
|
||||
@ -2737,8 +2736,7 @@ import {HostListener} from '../../src/metadata/directives';
|
||||
expect(engine.players[0].getRealPlayer()).toBe(players[1]);
|
||||
});
|
||||
|
||||
fixmeIvy('unknown').it(
|
||||
'should fire and synchronize the start/done callbacks on sub triggers even if they are not allowed to animate within the animation',
|
||||
it('should fire and synchronize the start/done callbacks on sub triggers even if they are not allowed to animate within the animation',
|
||||
fakeAsync(() => {
|
||||
@Component({
|
||||
selector: 'parent-cmp',
|
||||
@ -2838,8 +2836,7 @@ import {HostListener} from '../../src/metadata/directives';
|
||||
expect(child.log).toEqual(['child-start', 'child-done']);
|
||||
}));
|
||||
|
||||
fixmeIvy('unknown').it(
|
||||
'should fire and synchronize the start/done callbacks on multiple blocked sub triggers',
|
||||
it('should fire and synchronize the start/done callbacks on multiple blocked sub triggers',
|
||||
fakeAsync(() => {
|
||||
@Component({
|
||||
selector: 'cmp',
|
||||
|
@ -78,8 +78,6 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
||||
}
|
||||
|
||||
describe(`ChangeDetection`, () => {
|
||||
// On CJS fakeAsync is not supported...
|
||||
if (!getDOM().supportsDOMEvents()) return;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureCompiler({providers: TEST_COMPILER_PROVIDERS});
|
||||
@ -1211,7 +1209,7 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
||||
});
|
||||
|
||||
describe('mode', () => {
|
||||
fixmeIvy('unknown').it('Detached', fakeAsync(() => {
|
||||
it('Detached', fakeAsync(() => {
|
||||
const ctx = createCompFixture('<comp-with-ref></comp-with-ref>');
|
||||
const cmp: CompWithRef = queryDirs(ctx.debugElement, CompWithRef)[0];
|
||||
cmp.value = 'hello';
|
||||
|
@ -9,7 +9,7 @@
|
||||
import {ResourceLoader} from '@angular/compiler';
|
||||
import {CompileMetadataResolver} from '@angular/compiler/src/metadata_resolver';
|
||||
import {MockResourceLoader} from '@angular/compiler/testing/src/resource_loader_mock';
|
||||
import {Component, Directive, Injectable, NgModule, OnDestroy, Pipe, Type} from '@angular/core';
|
||||
import {Component, Directive, Injectable, NgModule, OnDestroy, Pipe} from '@angular/core';
|
||||
import {TestBed, async, getTestBed} from '@angular/core/testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {fixmeIvy} from '@angular/private/testing';
|
||||
|
Loading…
x
Reference in New Issue
Block a user