1
1
import { kickEachUser } from "../../../src/controllers/kickEachUser" ;
2
- import { discordTextResponse } from "../../../src/utils/discordResponse" ;
3
- import { removeUsers } from "../../../src/utils/removeUsers" ;
4
2
import { transformedArgument , ctx } from "../../fixtures/fixture" ;
5
3
6
4
describe ( "kickEachUser" , ( ) => {
@@ -27,38 +25,4 @@ describe("kickEachUser", () => {
27
25
"Found no users with the matched role."
28
26
) ;
29
27
} ) ;
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
- } ) ;
64
28
} ) ;
0 commit comments