From a2d4b050644f4e93e875d4c0f75bcd6376cc4cd5 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 22 May 2015 16:04:16 -0400 Subject: [PATCH] Add group test --- test/tests/groupsTest.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/tests/groupsTest.js diff --git a/test/tests/groupsTest.js b/test/tests/groupsTest.js new file mode 100644 index 000000000..adbf8d3aa --- /dev/null +++ b/test/tests/groupsTest.js @@ -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(); + } + } + }) + }) +})