Ignore unknown fields in Zotero.Item::fromJSON()
This commit is contained in:
parent
3025123cb8
commit
6d64526648
2 changed files with 18 additions and 1 deletions
|
@ -966,6 +966,17 @@ describe("Zotero.Item", function () {
|
|||
})
|
||||
|
||||
describe("#fromJSON()", function () {
|
||||
it("should ignore unknown fields", function* () {
|
||||
var json = {
|
||||
itemType: "journalArticle",
|
||||
title: "Test",
|
||||
foo: "Invalid"
|
||||
};
|
||||
var item = new Zotero.Item;
|
||||
item.fromJSON(json);
|
||||
assert.equal(item.getField('title'), 'Test');
|
||||
})
|
||||
|
||||
it("should accept ISO 8601 dates", function* () {
|
||||
var json = {
|
||||
itemType: "journalArticle",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue