Fix post-save textbox focusing bugs in right-hand pane

Fix a couple cases of lost text field focus after an edit, including
focusing of the Title field after using New Item when a field is already
being edited and has a changed value.

Also, in tests, select My Library and wait for items to load when using
the loadZoteroPane() support function. We could add a parameter to skip
that or move it to a separate function, but the code to detect it is a
bit convoluted and it's a prerequisite for many tests, so it's handy to
have a function for it.
This commit is contained in:
Dan Stillman 2015-05-04 02:00:52 -04:00
parent 590649fd49
commit 8fec5ace3a
7 changed files with 103 additions and 63 deletions

View file

@ -4,22 +4,10 @@ describe("Zotero.CollectionTreeView", function() {
// Load Zotero pane and select library
before(function* () {
win = yield loadZoteroPane();
var zp = win.ZoteroPane;
var cv = zp.collectionsView;
var resolve1, resolve2;
var promise1 = new Zotero.Promise(() => resolve1 = arguments[0]);
var promise2 = new Zotero.Promise(() => resolve2 = arguments[0]);
cv.addEventListener('load', () => resolve1())
yield promise1;
cv.selection.select(0);
zp.addEventListener('itemsLoaded', () => resolve2());
yield promise2;
collectionsView = zp.collectionsView;
collectionsView = win.ZoteroPane.collectionsView;
});
after(function () {
if (win) {
win.close();
}
win.close();
});
// Select library