Fix firstCreator for unsaved items

Necessary when editing embedded citations that don't exist in library
This commit is contained in:
Dan Stillman 2017-02-15 23:13:35 -05:00
parent 3830aa1125
commit bb665a56b6
4 changed files with 229 additions and 13 deletions

View file

@ -18,6 +18,23 @@ describe("Zotero.Item", function () {
item.setField('title', 'foo');
assert.strictEqual(item.getField('invalid'), "");
});
it("should return a firstCreator for an unsaved item", function* () {
var item = createUnsavedDataObject('item');
item.setCreators([
{
firstName: "A",
lastName: "B",
creatorType: "author"
},
{
firstName: "C",
lastName: "D",
creatorType: "editor"
}
]);
assert.equal(item.getField('firstCreator'), "B");
});
});
describe("#setField", function () {