Skip to content

Commit 01c526d

Browse files
committed
added new changes in test
1 parent a5010fb commit 01c526d

File tree

2 files changed

+0
-37
lines changed

2 files changed

+0
-37
lines changed
Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import { kickEachUser } from "../../../src/controllers/kickEachUser";
2-
import { discordTextResponse } from "../../../src/utils/discordResponse";
3-
import { removeUsers } from "../../../src/utils/removeUsers";
42
import { transformedArgument, ctx } from "../../fixtures/fixture";
53

64
describe("kickEachUser", () => {
@@ -27,38 +25,4 @@ describe("kickEachUser", () => {
2725
"Found no users with the matched role."
2826
);
2927
});
30-
31-
it("should run when found users with Matched Role", async () => {
32-
const env = {
33-
BOT_PUBLIC_KEY: "xyz",
34-
DISCORD_GUILD_ID: "123",
35-
DISCORD_TOKEN: "abc",
36-
};
37-
38-
const usersWithMatchingRole = [
39-
"<@282859044593598464>",
40-
"<@725745030706364447>",
41-
] as string[];
42-
43-
const { roleToBeTaggedObj } = transformedArgument; // Extracting roleToBeTaggedObj
44-
const response = kickEachUser(
45-
{ roleToBeRemovedObj: roleToBeTaggedObj },
46-
env,
47-
ctx
48-
);
49-
50-
expect(response).toEqual(
51-
expect.objectContaining({
52-
data: {
53-
content:
54-
"Found 2 users with the matched role, removing them shortly...",
55-
},
56-
})
57-
); // Ensure correct response message
58-
59-
// Check the arguments passed to removeUsers
60-
expect(removeUsers).toHaveBeenCalledWith(env, usersWithMatchingRole);
61-
62-
expect(response).toBeInstanceOf(Promise);
63-
});
6428
});

tests/unit/utils/removeUsers.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ describe("removeUsers", () => {
5555
await removeUsers(mockEnv, usersWithMatchingRole);
5656

5757
// Expectations
58-
expect(fetch).toHaveBeenCalledTimes(3);
5958
expect(fetch).toHaveBeenCalledWith(
6059
`${DISCORD_BASE_URL}/guilds/${mockEnv.DISCORD_GUILD_ID}/members/userId1`,
6160
{

0 commit comments

Comments
 (0)