title: Jasmin - component.instance doesn't show component's methods in Angular 8
body: <p>From jasmin - calling <code>component.instance.createNewShape()</code> returns an error </p>
  
  <blockquote>
    <p>component.instance.createNewShape is not a function</p>
  </blockquote>
  
  <p><code>console.log(component.instance)</code> returns the component but it contains only the properties and not its methods:</p>
  
  <pre><code>HomeComponent {selectedShape: 3, selectedMood: 1, allShapes: Array(0), shapeTypes: {…}, moodTypes: {…}, …}
  selectedShape: 3
  selectedMood: 1
  allShapes: []
  shapeTypes: {0: "Triangle", 1: "Square", 2: "Rectangle", 3: "Circle", Triangle: 0, Square: 1, Rectangle: 2, Circle: 3}
  moodTypes: {0: "Normal", 1: "Happy", 2: "SuperHappy", Normal: 0, Happy: 1, SuperHappy: 2}
  test: ""
  shapeParams: ShapeParams {}
  newShape: Circle {shapeType: 3, corners: 0, moodType: 1}
  __proto__: Object
  </code></pre>
  
  <p>Here is the code of the components:</p>
  
  <pre><code>import { ShapeType } from './../../models/enums/shape-type.enum';
  import { MoodType } from './../../models/enums/mood-type.enum';
  import { Component } from '@angular/core';
  import { BaseShape } from 'src/app/models/base-shape.model';
  import { ShapeFactory } from 'src/app/factories/shape.factory';
  import { ShapeParams } from 'src/app/models/shape-params.model';
  
  @Component({
    selector: 'app-home',
    templateUrl: './home.component.html',
    styleUrls: ['./home.component.css']
  })
  export class HomeComponent {
    public newShape: BaseShape;
    public shapeParams: ShapeParams;
    public selectedShape: ShapeType = ShapeType.Circle;
    public selectedMood: MoodType = MoodType.Happy;
    public allShapes: BaseShape[] = new Array();
  
    public shapeTypes = ShapeType;
    public moodTypes = MoodType;
    constructor() {
      this.reset();
    }
  
    public createNewShape(shape: ShapeType, mood: MoodType) {
      this.newShape = ShapeFactory.CreateShape(shape, mood);
    }
  
    public submitShape() {
      this.newShape.submitParams(this.shapeParams);
      this.allShapes.push(this.newShape);
      this.reset();
    }
    public getTotalArea() {
      let sum = 0;
      this.allShapes.forEach(shape =&gt; {
        sum += shape.getArea();
      });
      return sum;
    }
    private reset() {
      this.shapeParams = new ShapeParams();
      this.newShape = ShapeFactory.CreateShape(
        this.selectedShape,
        this.selectedMood
      );
    }
  }
  
  
  </code></pre>
  
  <p>Why I can't access my methods?
  (if you have any questions or recommendation about the question - write them as a comment. Thanks)</p>