Ignore unknown fields in Zotero.Item::fromJSON()

This commit is contained in:
Dan Stillman 2015-11-12 17:24:03 -05:00
parent 3025123cb8
commit 6d64526648
2 changed files with 18 additions and 1 deletions

View file

@ -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",