@@ -38,7 +38,7 @@ describe("get roles", () => {
38
38
39
39
it ( "should return role fetch failed error response if it fails to fetch roles" , async ( ) => {
40
40
getGuildRolesSpy . mockRejectedValueOnce ( {
41
- message : responseConstants . ROLE_FETCH_FAILED_MESSAGE ,
41
+ message : responseConstants . ROLE_FETCH_FAILED ,
42
42
} ) ;
43
43
const mockRequest = generateDummyRequestObject ( {
44
44
url : "/roles" ,
@@ -50,7 +50,9 @@ describe("get roles", () => {
50
50
) ;
51
51
const jsonResponse = await response . json ( ) ;
52
52
expect ( response . status ) . toBe ( 500 ) ;
53
- expect ( jsonResponse ) . toEqual ( responseConstants . ROLE_FETCH_FAILED_ERROR ) ;
53
+ expect ( jsonResponse ) . toEqual ( {
54
+ error : responseConstants . ROLE_FETCH_FAILED ,
55
+ } ) ;
54
56
} ) ;
55
57
56
58
it ( "should return internal server error response if it fails for any other reason" , async ( ) => {
@@ -189,7 +191,7 @@ describe("get role by role name", () => {
189
191
190
192
it ( "should return role fetch failed error if there was an error while fetching roles" , async ( ) => {
191
193
getGuildRoleByNameSpy . mockRejectedValueOnce ( {
192
- message : responseConstants . ROLE_FETCH_FAILED_MESSAGE ,
194
+ message : responseConstants . ROLE_FETCH_FAILED ,
193
195
} ) ;
194
196
195
197
const mockRequest = generateDummyRequestObject ( {
@@ -206,7 +208,9 @@ describe("get role by role name", () => {
206
208
) ;
207
209
const jsonResponse : { roles : Array < GuildRole > } = await response . json ( ) ;
208
210
expect ( response . status ) . toBe ( 500 ) ;
209
- expect ( jsonResponse ) . toEqual ( responseConstants . ROLE_FETCH_FAILED_ERROR ) ;
211
+ expect ( jsonResponse ) . toEqual ( {
212
+ error : responseConstants . ROLE_FETCH_FAILED ,
213
+ } ) ;
210
214
} ) ;
211
215
212
216
it ( "should return internal server error if there was any other error" , async ( ) => {
0 commit comments