Add getGroup() and createGroup() test support functions
getGroup() can be used to access a default group library for general group tests. createGroup() can be used to create one for a particular test or set of tests.
This commit is contained in:
parent
5a5a8a93f9
commit
c1cb832b0b
2 changed files with 26 additions and 10 deletions
|
@ -1,17 +1,9 @@
|
|||
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)
|
||||
var group = yield createGroup();
|
||||
assert.equal(Zotero.Groups.get(group.id), group)
|
||||
}
|
||||
finally {
|
||||
if (group) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue