Fix getBestAttachmentState()
tests after b0ba7e464
This commit is contained in:
parent
bbf3180a10
commit
1e1969a089
1 changed files with 8 additions and 2 deletions
|
@ -1147,7 +1147,10 @@ describe("Zotero.Item", function () {
|
||||||
parentItemID: parentItem.id
|
parentItemID: parentItem.id
|
||||||
});
|
});
|
||||||
yield parentItem.getBestAttachmentState();
|
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* () {
|
it("should cache state for a missing file", function* () {
|
||||||
|
@ -1161,7 +1164,10 @@ describe("Zotero.Item", function () {
|
||||||
let path = yield childItem.getFilePathAsync();
|
let path = yield childItem.getFilePathAsync();
|
||||||
yield OS.File.remove(path);
|
yield OS.File.remove(path);
|
||||||
yield parentItem.getBestAttachmentState();
|
yield parentItem.getBestAttachmentState();
|
||||||
assert.equal(parentItem.getBestAttachmentStateCached(), -1);
|
assert.deepEqual(
|
||||||
|
parentItem.getBestAttachmentStateCached(),
|
||||||
|
{ type: 'other', exists: false }
|
||||||
|
);
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue