Fix another PDF retrieval test after be8db4fc50

This commit is contained in:
Dan Stillman 2018-10-09 19:02:46 -04:00
parent f3aef41c90
commit 477c28b1e3
2 changed files with 10 additions and 9 deletions

View file

@ -931,6 +931,7 @@ describe("Zotero.ItemTreeView", function() {
// Wait for attachment item to be moved under new item
await waitForItemEvent('add');
await waitForItemEvent('modify');
await waitForItemEvent('modify');
assert.isFalse(Zotero.Items.get(attachmentIDs[0]).isTopLevelItem());

View file

@ -799,7 +799,6 @@ describe("Connector Server", function () {
httpd.registerFile("/test.pdf", file);
var promise = waitForItemEvent('add');
var recognizerPromise = waitForRecognizer();
var origRequest = Zotero.HTTP.request.bind(Zotero.HTTP);
var called = 0;
@ -836,15 +835,16 @@ describe("Connector Server", function () {
var ids = await promise;
assert.lengthOf(ids, 1);
var item = Zotero.Items.get(ids[0]);
assert.isTrue(item.isImportedAttachment());
assert.equal(item.attachmentContentType, 'application/pdf');
assert.isTrue(collection.hasItem(item.id));
var attachment = Zotero.Items.get(ids[0]);
assert.isTrue(attachment.isImportedAttachment());
assert.equal(attachment.attachmentContentType, 'application/pdf');
assert.isTrue(collection.hasItem(attachment.id));
var progressWindow = await recognizerPromise;
progressWindow.close();
Zotero.ProgressQueues.get('recognize').cancel();
assert.isFalse(item.isTopLevelItem());
await waitForItemEvent('add');
await waitForItemEvent('modify');
await waitForItemEvent('modify');
assert.isFalse(attachment.isTopLevelItem());
stub.restore();
});