I have a question, I need to simulate slow network on my e2e tests with Protractor. I'm using anuglar-cli and angular5.
I have tried to find a way to simulate slow network without success, using setNetworkConnection
But it's fails to work and throws an exception.
The issue is only on slow network my typeahead is creating an extra call, because the before call haven't completed yet, I'm using this function to do it:
this.modelChanged
.debounceTime(400)
.distinctUntilChanged()
.subscribe((model: FilterModel) => {
this.filters.set(model.filterName, model.filterVal);
const filters = {};
this.filters.forEach((value: any, key: string) => {
filters[key] = value;
});
this.ds.changeData({
filters: filters
});
});
Maybe you will have a better suggestion to fix it too. Will gladly accept any suggestion.
Now I need to test it, to prevent the regression, when I will fix it with a better solution.
Thanks in advance.