test(ivy): enable more @angular/core tests (#27912)

PR Close #27912
This commit is contained in:
Marc Laval 2019-01-03 16:20:40 +01:00 committed by Ben Lesh
parent 460be795cf
commit b7d0ab7de3

View File

@ -557,34 +557,27 @@ class TestComp {
.toEqual('parentService'); .toEqual('parentService');
}); });
fixmeIvy('FW-890: Overridden providers are not found during dependency resolution') it('should instantiate directives that depend on providers of a component', () => {
.it('should instantiate directives that depend on providers of a component', () => {
TestBed.configureTestingModule({declarations: [SimpleComponent, NeedsService]}); TestBed.configureTestingModule({declarations: [SimpleComponent, NeedsService]});
TestBed.overrideComponent( TestBed.overrideComponent(
SimpleComponent, SimpleComponent, {set: {providers: [{provide: 'service', useValue: 'hostService'}]}});
{set: {providers: [{provide: 'service', useValue: 'hostService'}]}}); TestBed.overrideComponent(SimpleComponent, {set: {template: '<div needsService></div>'}});
TestBed.overrideComponent(
SimpleComponent, {set: {template: '<div needsService></div>'}});
const el = createComponent('<div simpleComponent></div>'); const el = createComponent('<div simpleComponent></div>');
expect(el.children[0].children[0].injector.get(NeedsService).service) expect(el.children[0].children[0].injector.get(NeedsService).service)
.toEqual('hostService'); .toEqual('hostService');
}); });
fixmeIvy('FW-890: Overridden providers are not found during dependency resolution') it('should instantiate directives that depend on view providers of a component', () => {
.it('should instantiate directives that depend on view providers of a component', () => {
TestBed.configureTestingModule({declarations: [SimpleComponent, NeedsService]}); TestBed.configureTestingModule({declarations: [SimpleComponent, NeedsService]});
TestBed.overrideComponent( TestBed.overrideComponent(
SimpleComponent, SimpleComponent, {set: {providers: [{provide: 'service', useValue: 'hostService'}]}});
{set: {providers: [{provide: 'service', useValue: 'hostService'}]}}); TestBed.overrideComponent(SimpleComponent, {set: {template: '<div needsService></div>'}});
TestBed.overrideComponent(
SimpleComponent, {set: {template: '<div needsService></div>'}});
const el = createComponent('<div simpleComponent></div>'); const el = createComponent('<div simpleComponent></div>');
expect(el.children[0].children[0].injector.get(NeedsService).service) expect(el.children[0].children[0].injector.get(NeedsService).service)
.toEqual('hostService'); .toEqual('hostService');
}); });
fixmeIvy('FW-890: Overridden providers are not found during dependency resolution') it('should instantiate directives in a root embedded view that depend on view providers of a component',
.it('should instantiate directives in a root embedded view that depend on view providers of a component',
() => { () => {
TestBed.configureTestingModule({declarations: [SimpleComponent, NeedsService]}); TestBed.configureTestingModule({declarations: [SimpleComponent, NeedsService]});
TestBed.overrideComponent( TestBed.overrideComponent(
@ -961,15 +954,13 @@ class TestComp {
}); });
describe('pipes', () => { describe('pipes', () => {
fixmeIvy('FW-890: Overridden providers are not found during dependency resolution') it('should instantiate pipes that have dependencies', () => {
.it('should instantiate pipes that have dependencies', () => {
TestBed.configureTestingModule({declarations: [SimpleDirective, PipeNeedsService]}); TestBed.configureTestingModule({declarations: [SimpleDirective, PipeNeedsService]});
const el = createComponent( const el = createComponent(
'<div [simpleDirective]="true | pipeNeedsService"></div>', '<div [simpleDirective]="true | pipeNeedsService"></div>',
[{provide: 'service', useValue: 'pipeService'}]); [{provide: 'service', useValue: 'pipeService'}]);
expect(el.children[0].injector.get(SimpleDirective).value.service) expect(el.children[0].injector.get(SimpleDirective).value.service).toEqual('pipeService');
.toEqual('pipeService');
}); });
fixmeIvy('FW-894: Pipes don\'t overwrite pipes with later entry in the pipes array') fixmeIvy('FW-894: Pipes don\'t overwrite pipes with later entry in the pipes array')