@@ -20,9 +20,6 @@ const getGuildRolesSpy = jest.spyOn(guildRoleUtils, "getGuildRoles");
20
20
const getGuildRoleByNameSpy = jest . spyOn ( guildRoleUtils , "getGuildRoleByName" ) ;
21
21
22
22
describe ( "get roles" , ( ) => {
23
- beforeEach ( ( ) => {
24
- jest . resetAllMocks ( ) ;
25
- } ) ;
26
23
it ( "should return a instance of JSONResponse" , async ( ) => {
27
24
const mockRequest = generateDummyRequestObject ( { url : "/roles" } ) ;
28
25
const response = await getGuildRolesHandler ( mockRequest , guildEnv ) ;
@@ -148,7 +145,7 @@ describe("get role by role name", () => {
148
145
expect ( jsonResponse ) . toEqual ( responseConstants . BAD_SIGNATURE ) ;
149
146
} ) ;
150
147
151
- it ( "should return Not Found error if no roleName is not provided" , async ( ) => {
148
+ it ( "should return BAD REQUEST error if roleName is not provided" , async ( ) => {
152
149
getGuildRoleByNameSpy . mockResolvedValueOnce ( undefined ) ;
153
150
const mockRequest = generateDummyRequestObject ( {
154
151
url : "/roles" ,
@@ -162,7 +159,7 @@ describe("get role by role name", () => {
162
159
) ;
163
160
const jsonResponse : { error : string } = await response . json ( ) ;
164
161
expect ( response . status ) . toBe ( 404 ) ;
165
- expect ( jsonResponse ) . toEqual ( responseConstants . NOT_FOUND ) ;
162
+ expect ( jsonResponse ) . toEqual ( responseConstants . BAD_REQUEST ) ;
166
163
} ) ;
167
164
168
165
it ( "should return not found object if there is no roles with given name in guild" , async ( ) => {
0 commit comments