Z7: Fix ZoteroPane tests

This commit is contained in:
Dan Stillman 2023-04-29 04:24:01 -04:00
parent 8fc94a5560
commit 26dade03f2

View file

@ -19,7 +19,7 @@ describe("ZoteroPane", function() {
it("should create an item and focus the title field", function* () { it("should create an item and focus the title field", function* () {
yield zp.newItem(Zotero.ItemTypes.getID('book'), {}, null, true); yield zp.newItem(Zotero.ItemTypes.getID('book'), {}, null, true);
var itemBox = doc.getElementById('zotero-editpane-item-box'); var itemBox = doc.getElementById('zotero-editpane-item-box');
var textboxes = itemBox.shadowRoot.querySelectorAll('input, textarea'); var textboxes = itemBox.querySelectorAll('input, textarea');
assert.lengthOf(textboxes, 1); assert.lengthOf(textboxes, 1);
assert.equal(textboxes[0].getAttribute('fieldname'), 'title'); assert.equal(textboxes[0].getAttribute('fieldname'), 'title');
textboxes[0].blur(); textboxes[0].blur();
@ -30,7 +30,7 @@ describe("ZoteroPane", function() {
var value = "Test"; var value = "Test";
var item = yield zp.newItem(Zotero.ItemTypes.getID('book'), {}, null, true); var item = yield zp.newItem(Zotero.ItemTypes.getID('book'), {}, null, true);
var itemBox = doc.getElementById('zotero-editpane-item-box'); var itemBox = doc.getElementById('zotero-editpane-item-box');
var textbox = itemBox.shadowRoot.querySelector('textarea'); var textbox = itemBox.querySelector('textarea');
textbox.value = value; textbox.value = value;
yield itemBox.blurOpenField(); yield itemBox.blurOpenField();
item = yield Zotero.Items.getAsync(item.id); item = yield Zotero.Items.getAsync(item.id);
@ -1037,7 +1037,7 @@ describe("ZoteroPane", function() {
searchBox.search.addCondition("title", "contains", "foo") searchBox.search.addCondition("title", "contains", "foo")
); );
searchBox.addCondition(c); searchBox.addCondition(c);
win.document.documentElement.acceptDialog(); win.document.querySelector('dialog').acceptDialog();
}); });
yield zp.editSelectedCollection(); yield zp.editSelectedCollection();
yield promise; yield promise;
@ -1054,7 +1054,7 @@ describe("ZoteroPane", function() {
searchBox.search.addCondition("title", "contains", "foo") searchBox.search.addCondition("title", "contains", "foo")
); );
searchBox.addCondition(c); searchBox.addCondition(c);
win.document.documentElement.acceptDialog(); win.document.querySelector('dialog').acceptDialog();
}); });
yield zp.editSelectedCollection(); yield zp.editSelectedCollection();
yield promise; yield promise;