Throw an error saving an empty item with no item type

This commit is contained in:
Dan Stillman 2015-07-20 04:14:51 -04:00
parent cd4d084dd9
commit 258b70b455
2 changed files with 16 additions and 3 deletions

View file

@ -682,6 +682,15 @@ describe("Zotero.Item", function () {
})
})
describe("#save()", function () {
it("should throw an error for an empty item without an item type", function* () {
var item = new Zotero.Item;
var e = yield getPromiseError(item.saveTx());
assert.ok(e);
assert.equal(e.message, "Item type must be set before saving");
})
})
describe("#clone()", function () {
// TODO: Expand to other data
it("should copy creators", function* () {