title: Unit testing - onGridReady - Ag-grid event in Angular
body: <p>I am having a function like below in my component file like below</p>
  <pre class="lang-js prettyprint-override"><code>onGridReady(params) {
    this.gridApi = params.api;
    this.columnApi = params.columnApi;
    this.gridApi.setDomLayout('autoHeight');
    this.gridApi.sizeColumnsToFit();
    params.api.setRowData(this.deviceConfigurations);
  }
  </code></pre>
  <p>For the above function I am writing the spec like the below one</p>
  <pre class="lang-js prettyprint-override"><code>describe('#onGridReady()', () =&gt; {
      const params = {
        api: new MockGridApi(),
        ColumnApi: new MockColumnApi(),
      };
  
      it('call the function', () =&gt; {
        spyOn(component, 'onGridReady').and.callThrough();
        component.onGridReady(params);
  
        expect(component.onGridReady).toHaveBeenCalled();
      });
    });
  </code></pre>
  <p>The spec passes as well as the coverage is done for the above function. But I would like to know whether is it the correct way or writing the spec or do I need to write more specs like to <code>sizeColumnsToFit()</code> has been called etc.,
  Could anyone can give your view about it.</p>