Skip to content

Commit

Permalink
Add groups.delete
Browse files Browse the repository at this point in the history
  • Loading branch information
frdmn committed Oct 24, 2018
1 parent 2cfbb36 commit 4f69bfa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/api/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ class Groups {
return this.client.request("POST", "groups.create", { name, members}, callback);
}

delete (roomId, callback) {
return this.client.request("POST", "groups.delete", {roomId}, callback);
}

getIntegrations(roomId, { offset = 0, count = 0, sort = undefined, fields = undefined, query = undefined} ={}, callback) {
let options = {roomId};
Object.assign(options, pageQueryMapping(arguments[1]));
Expand Down
11 changes: 11 additions & 0 deletions test/groups.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,4 +375,15 @@ describe("groups", () => {
});
});
});

describe("deleting group", function () {
it("should delete the group successfully", function (done) {
rocketChatClient.groups.delete(createGroupId, function (err, result) {
should(err).be.null();
should(result).not.be.null();
should(result.success).be.true();
done();
});
});
});
});

0 comments on commit 4f69bfa

Please sign in to comment.