Fix getBestAttachmentState() tests after b0ba7e464

This commit is contained in:
Dan Stillman 2021-12-22 05:23:16 -05:00
parent bbf3180a10
commit 1e1969a089

View file

@ -1147,7 +1147,10 @@ describe("Zotero.Item", function () {
parentItemID: parentItem.id
});
yield parentItem.getBestAttachmentState();
assert.equal(parentItem.getBestAttachmentStateCached(), 1);
assert.deepEqual(
parentItem.getBestAttachmentStateCached(),
{ type: 'other', exists: true }
);
})
it("should cache state for a missing file", function* () {
@ -1161,7 +1164,10 @@ describe("Zotero.Item", function () {
let path = yield childItem.getFilePathAsync();
yield OS.File.remove(path);
yield parentItem.getBestAttachmentState();
assert.equal(parentItem.getBestAttachmentStateCached(), -1);
assert.deepEqual(
parentItem.getBestAttachmentStateCached(),
{ type: 'other', exists: false }
);
})
})