title: How can I make Input setter Function is called while testing
body: <p>Im trying to spy a function of a component. I can spy that but my test code does not invoke the  Input setter of this component.</p>
  
  <pre><code>export class CameraComponent implements OnInit {
  
      liveData: LiveDataModal[];
      @Input('liveData')
      set setLiveData(data: LiveDataModal[]) {
        this.liveData = data;
        this.renderCanvas();
      }
      renderCanvas() {
       // ...
      }
  
  }
  
  describe('CameraComponent', () =&gt; {
    it('should re render', () =&gt; {
      const fixture = TestBed.createComponent(CameraComponent);
      const component = fixture.componentInstance;
      fixture.detectChanges();
  
      expect(component).toBeTruthy();
      const renderCanvasSpy = spyOn(component, 'renderCanvas')
  
      component.liveData = [];
      component.renderCanvas();
  
      fixture.detectChanges();
      const invokeCount = renderCanvasSpy.calls.count();
      expect(invokeCount).toEqual(2)
      // invokeCount should be to 2 but its 1
    });
  })
  </code></pre>