Don't trigger translator loading in download-on-demand test

This was causing later tests to time out.
This commit is contained in:
Dan Stillman 2016-11-20 02:46:04 -05:00
parent 6c6a775be2
commit ce5328cbc4

View file

@ -221,8 +221,15 @@ describe("ZoteroPane", function() {
} }
); );
// Disable loadURI() so viewAttachment() doesn't trigger translator loading
var stub = sinon.stub(zp, "loadURI");
yield zp.viewAttachment(item.id); yield zp.viewAttachment(item.id);
assert.ok(stub.calledOnce);
assert.ok(stub.calledWith(OS.Path.toFileURI(item.getFilePath())));
stub.restore();
assert.equal((yield item.attachmentHash), md5); assert.equal((yield item.attachmentHash), md5);
assert.equal((yield item.attachmentModificationTime), mtime); assert.equal((yield item.attachmentModificationTime), mtime);
var path = yield item.getFilePathAsync(); var path = yield item.getFilePathAsync();