I am writing a spec file for one of my component files in which the window.location.reload() is used.
toggleFloatingFilter() {
this.hasFloatingFilter = !this.hasFloatingFilter;
this.clearSelectedRows();
this.gridApi.setRowData(this.rowData);
if (!this.hasFloatingFilter) {
this.gridApi.setFilterModel(null);
this.loadData();
}
setTimeout(() => {
this.gridApi.refreshHeader();
}, 0);
window.location.reload();
}
When i run the test once it hits the window.location.reload() part the test starts from the beginning and it gets repeated. Can i know how-to skip the window.location.reload in unit test