Skip to content

Commit fbbfb54

Browse files
committed
changing variable name
1 parent 612d912 commit fbbfb54

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

models/discordactions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const getNumberOfMemberForGroups = async (groups = []) => {
136136

137137
return groups.map((group) => ({
138138
...group,
139-
count: roleCount[group.roleid] || 0,
139+
memberCount: roleCount[group.roleid] || 0,
140140
}));
141141
} catch (err) {
142142
logger.error("Error while counting members for each group", err);

test/integration/discordactions.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe("Discord actions", function () {
131131
expect(res).to.have.status(200);
132132
expect(res.body).to.be.an("object");
133133
// Verify presence of specific properties in each group
134-
const expectedProps = ["roleid", "rolename", "count", "firstName", "lastName", "image"];
134+
const expectedProps = ["roleid", "rolename", "memberCount", "firstName", "lastName", "image"];
135135
res.body.groups.forEach((group) => {
136136
expect(group).to.include.all.keys(expectedProps);
137137
});

test/unit/models/discordactions.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,12 @@ describe("discordactions", function () {
271271
expect(result.length).to.equal(0);
272272
});
273273

274-
it("should return group details with count details ", async function () {
274+
it("should return group details with memberCount details ", async function () {
275275
const result = await getNumberOfMemberForGroups(groupData);
276276
expect(result).to.deep.equal([
277-
{ rolename: groupData[0].rolename, roleid: 1, count: 3 },
278-
{ rolename: groupData[1].rolename, roleid: 2, count: 1 },
279-
{ rolename: groupData[2].rolename, roleid: 3, count: 0 },
277+
{ rolename: groupData[0].rolename, roleid: 1, memberCount: 3 },
278+
{ rolename: groupData[1].rolename, roleid: 2, memberCount: 1 },
279+
{ rolename: groupData[2].rolename, roleid: 3, memberCount: 0 },
280280
]);
281281
});
282282
});

0 commit comments

Comments
 (0)