groupsTest.js (791B)
1 describe("Zotero.Groups", function () { 2 describe("#get()", function () { 3 it("should retrieve a newly created group", function* () { 4 try { 5 var group = yield createGroup(); 6 assert.equal(Zotero.Groups.get(group.id), group) 7 } 8 finally { 9 if (group) { 10 yield Zotero.DB.executeTransaction(function* () { 11 return group.erase(); 12 }) 13 } 14 } 15 }) 16 }) 17 18 describe("#save()", function () { 19 it("should trigger notifier event for inherited properties", function* () { 20 var group = yield createGroup({ 21 editable: false 22 }); 23 group.editable = true; 24 25 var promise = waitForNotifierEvent('modify', 'group'); 26 yield group.saveTx(); 27 var data = yield promise; 28 assert.lengthOf(data.ids, 1); 29 assert.sameMembers(data.ids, [group.id]); 30 }); 31 }); 32 })