DEV: correct test suite

We have no choice but to bypass recursive debouncers in test

Otherwise we overrun the stack with frames
This commit is contained in:
Sam Saffron 2020-05-14 16:41:34 +10:00
parent ce4b5b56e5
commit 3d050bdaa3
No known key found for this signature in database
GPG Key ID: B9606168D2FFD9F5
1 changed files with 5 additions and 1 deletions

View File

@ -1096,7 +1096,11 @@ export default Controller.extend({
const model = this.model;
if (model) {
if (model.draftSaving) {
debounce(this, this._saveDraft, 2000);
// in test debounce is Ember.run, this will cause
// an infinite loop
if (ENV.environment !== "test") {
debounce(this, this._saveDraft, 2000);
}
} else {
model.saveDraft().finally(() => {
this._lastDraftSaved = Date.now();