Fix test failures due to rapid attachment note initialization
81739c7a66
prevented new windows from working after a restart error,
and full-text tests (and possibly others) create attachments quickly in
a way that was causing init callbacks to receive a TinyMCE editor with
missing functions (possibly because they were already removed?). This
just ignores those errors, which isn't a great solution, but it probably
won't happen in real use, so let's see if it works.
This commit is contained in:
parent
440b65935e
commit
ad6c3f7a09
1 changed files with 16 additions and 0 deletions
|
@ -534,6 +534,12 @@
|
|||
return ;
|
||||
}
|
||||
|
||||
// Hack to ignore incomplete editors due to rapid note creation in tests
|
||||
if (Zotero.test && !this._editor.getContent) {
|
||||
Zotero.logError("editor.getContent doesn't exist");
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.value == val) {
|
||||
Zotero.debug("Textbox value hasn't changed");
|
||||
this._changed = false;
|
||||
|
@ -623,6 +629,11 @@
|
|||
<parameter name="callback"/>
|
||||
<body><![CDATA[
|
||||
if (this.initialized) {
|
||||
// Hack to ignore incomplete editors due to rapid note creation in tests
|
||||
if (Zotero.test && !this._editor.setMode) {
|
||||
Zotero.logError("editor.setMode doesn't exist after initialization");
|
||||
return;
|
||||
}
|
||||
callback(this._editor);
|
||||
}
|
||||
else {
|
||||
|
@ -741,6 +752,11 @@
|
|||
let cb;
|
||||
if (this._onInitCallbacks) {
|
||||
while (cb = this._onInitCallbacks.shift()) {
|
||||
// Hack to ignore incomplete editors due to rapid note creation in tests
|
||||
if (Zotero.test && !this._editor.setMode) {
|
||||
Zotero.logError("editor.setMode doesn't exist");
|
||||
return;
|
||||
}
|
||||
cb(this._editor);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue