add mailboxdb.getGroup tests

This commit is contained in:
Girish Ramakrishnan
2016-09-27 16:34:28 -07:00
parent 20708ad25a
commit a91ae2b9aa
2 changed files with 18 additions and 0 deletions

View File

@@ -197,6 +197,17 @@ describe('Group membership', function () {
});
});
it('can get list members', function (done) {
mailboxdb.getGroup(GROUP0_NAME.toLowerCase(), function (error, result) {
expect(error).to.be(null);
expect(result.name).to.be(GROUP0_NAME.toLowerCase());
expect(result.ownerType).to.be(mailboxdb.TYPE_GROUP);
expect(result.ownerId).to.be(GROUP0_ID);
expect(result.members).to.eql([ USER_0.username ]);
done();
});
});
it('cannot get members of non-existent group', function (done) {
groups.getMembers('randomgroup', function (error, result) {
expect(result.length).to.be(0); // currently, we cannot differentiate invalid groups and empty groups