vendredi 1 novembre 2019

ag-grid Jest testing - this.btFirst.insertAdjacentElement is not a function

I try to test ag-grid component using Jest:

describe('DataGridInternal Component Tests', () => {
  it('includes class names on DataGrid', () => {
    const component = mount(<DataGridInternal {...SAMPLE_PROPS} />);
    expect(component.find('[data-test="ccfk-datagrid"]')).toHaveClassName('csf-material-grid');

  });
});

I get the exception :

TypeError: this.btFirst.insertAdjacentElement is not a function

coming from

node_modules/ag-grid-community/dist/lib/rowModels/pagination/paginationComp.js:49

Once I remark this line the test is passing OK

any idea what is not correct?

I`m using :

"ag-grid-community": "21.2.2",       
"ag-grid-react": "21.2.2",
"enzyme": "3.10.0",
"enzyme-adapter-react-16": "1.14.0",
"enzyme-to-json": "3.3.5"

Aucun commentaire:

Enregistrer un commentaire