diff --git a/packages/elements/test/component-factory-strategy_spec.ts b/packages/elements/test/component-factory-strategy_spec.ts index 577392fff2..bde7f1f134 100644 --- a/packages/elements/test/component-factory-strategy_spec.ts +++ b/packages/elements/test/component-factory-strategy_spec.ts @@ -329,14 +329,15 @@ export class FakeComponent { export class FakeComponentFactory extends ComponentFactory { componentRef: any = jasmine.createSpyObj( - 'componentRef', ['instance', 'changeDetectorRef', 'hostView', 'destroy']); - - constructor() { - super(); - this.componentRef.instance = new FakeComponent(); - this.componentRef.changeDetectorRef = - jasmine.createSpyObj('changeDetectorRef', ['detectChanges']); - } + 'componentRef', + // Method spies. + ['destroy'], + // Property spies. + { + changeDetectorRef: jasmine.createSpyObj('changeDetectorRef', ['detectChanges']), + hostView: {}, + instance: new FakeComponent(), + }); get selector(): string { return 'fake-component';