Add group test
This commit is contained in:
parent
23e4e54c29
commit
a2d4b05064
23
test/tests/groupsTest.js
Normal file
23
test/tests/groupsTest.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
describe("Zotero.Groups", function () {
|
||||||
|
describe("#get()", function () {
|
||||||
|
it("should retrieve a newly created group", function* () {
|
||||||
|
var group = new Zotero.Group;
|
||||||
|
group.id = 1851251;
|
||||||
|
group.libraryID = yield Zotero.ID.get('libraries');
|
||||||
|
group.name = "Test";
|
||||||
|
group.description = "";
|
||||||
|
group.editable = true;
|
||||||
|
group.filesEditable = true;
|
||||||
|
group.version = 1234;
|
||||||
|
try {
|
||||||
|
yield group.save();
|
||||||
|
assert.equal(Zotero.Groups.get(1851251), group)
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
if (group) {
|
||||||
|
yield group.erase();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user