zotero/test/tests/groupsTest.js
Abe Jellinek 67d2e1cead fx140: Asyncify/ESMify tests
They seem to be succeeding when run individually, but failing when
run as a whole. Not sure why yet.
2025-07-30 22:30:53 -04:00

32 lines
806 B
JavaScript

describe("Zotero.Groups", function () {
describe("#get()", function () {
it("should retrieve a newly created group", async function () {
try {
var group = await createGroup();
assert.equal(Zotero.Groups.get(group.id), group)
}
finally {
if (group) {
await Zotero.DB.executeTransaction(async function () {
return group.erase();
})
}
}
})
})
describe("#save()", function () {
it("should trigger notifier event for inherited properties", async function () {
var group = await createGroup({
editable: false
});
group.editable = true;
var promise = waitForNotifierEvent('modify', 'group');
await group.saveTx();
var data = await promise;
assert.lengthOf(data.ids, 1);
assert.sameMembers(data.ids, [group.id]);
});
});
})