Fix clearing of annotation fields
This commit is contained in:
parent
69958d4356
commit
6ee3863e37
2 changed files with 12 additions and 1 deletions
|
@ -274,5 +274,16 @@ describe("Zotero.Annotations", function() {
|
|||
assert.deepEqual(annotation[itemProp], exampleImageAlt[prop], `'${prop}' doesn't match`);
|
||||
}
|
||||
});
|
||||
|
||||
it("should remove empty fields", async function () {
|
||||
var annotation = await Zotero.Annotations.saveFromJSON(attachment, exampleHighlight);
|
||||
var json = Object.assign({}, exampleHighlight);
|
||||
json.comment = '';
|
||||
json.pageLabel = '';
|
||||
await Zotero.Annotations.saveFromJSON(attachment, json);
|
||||
|
||||
assert.equal(annotation.annotationComment, '');
|
||||
assert.equal(annotation.annotationPageLabel, '');
|
||||
});
|
||||
});
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue