@@ -20,9 +20,6 @@ const getGuildRolesSpy = jest.spyOn(guildRoleUtils, "getGuildRoles");
2020const getGuildRoleByNameSpy = jest . spyOn ( guildRoleUtils , "getGuildRoleByName" ) ;
2121
2222describe ( "get roles" , ( ) => {
23- beforeEach ( ( ) => {
24- jest . resetAllMocks ( ) ;
25- } ) ;
2623 it ( "should return a instance of JSONResponse" , async ( ) => {
2724 const mockRequest = generateDummyRequestObject ( { url : "/roles" } ) ;
2825 const response = await getGuildRolesHandler ( mockRequest , guildEnv ) ;
@@ -148,7 +145,7 @@ describe("get role by role name", () => {
148145 expect ( jsonResponse ) . toEqual ( responseConstants . BAD_SIGNATURE ) ;
149146 } ) ;
150147
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 ( ) => {
152149 getGuildRoleByNameSpy . mockResolvedValueOnce ( undefined ) ;
153150 const mockRequest = generateDummyRequestObject ( {
154151 url : "/roles" ,
@@ -162,7 +159,7 @@ describe("get role by role name", () => {
162159 ) ;
163160 const jsonResponse : { error : string } = await response . json ( ) ;
164161 expect ( response . status ) . toBe ( 404 ) ;
165- expect ( jsonResponse ) . toEqual ( responseConstants . NOT_FOUND ) ;
162+ expect ( jsonResponse ) . toEqual ( responseConstants . BAD_REQUEST ) ;
166163 } ) ;
167164
168165 it ( "should return not found object if there is no roles with given name in guild" , async ( ) => {
0 commit comments