Fix firstCreator for unsaved items
Necessary when editing embedded citations that don't exist in library
This commit is contained in:
parent
3830aa1125
commit
bb665a56b6
4 changed files with 229 additions and 13 deletions
|
@ -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 () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue