In my angular app, I need to mock the handsontable in angular test cases and write tests for handsontable methods such as onchange , afterSetDataAtCell etc.
I tried below,
class MockHotRegisterer extends HotRegisterer {
getSelected() {
}
getDataAtCol = function(col) {
return false;
};
}
class MockHotTable extends HotTableModule {
columns: [
{},
{
renderer: (instance, TD, row, col, prop, value, cellProperties) => {
}
}
];
countRows = function () {
};
afterSetDataAtCell = function (e: MockEvent) {
};
}
In my tests, I have
const mockHotTable = new MockHotTable();
component.columns = mockHotTable.columns;
component.tableInstance = mockHotTable;
But doesn’t seems to be working.