@@ -91,20 +91,20 @@ describe('Home integration tests:', () => {
9191 }
9292 } ) ;
9393
94- test ( 'should return 422 when GitHub API fails for releases ' , async ( ) => {
94+ test ( 'should return empty releases gracefully when GitHub API fails' , async ( ) => {
9595 axios . get . mockRejectedValueOnce ( new Error ( 'GitHub API unavailable' ) ) ;
96- const result = await agent . get ( '/api/home/releases' ) . expect ( 422 ) ;
97- expect ( result . body . type ) . toBe ( 'error ' ) ;
98- expect ( result . body . message ) . toBe ( 'Unprocessable Entity ' ) ;
99- expect ( result . body . description ) . toBe ( 'GitHub API unavailable.' ) ;
96+ const result = await agent . get ( '/api/home/releases' ) . expect ( 200 ) ;
97+ expect ( result . body . type ) . toBe ( 'success ' ) ;
98+ expect ( result . body . message ) . toBe ( 'releases ' ) ;
99+ expect ( result . body . data ) . toEqual ( [ ] ) ;
100100 } ) ;
101101
102- test ( 'should return 422 when GitHub API fails for changelogs ' , async ( ) => {
102+ test ( 'should return empty changelogs gracefully when GitHub API fails' , async ( ) => {
103103 axios . get . mockRejectedValueOnce ( new Error ( 'GitHub API unavailable' ) ) ;
104- const result = await agent . get ( '/api/home/changelogs' ) . expect ( 422 ) ;
105- expect ( result . body . type ) . toBe ( 'error ' ) ;
106- expect ( result . body . message ) . toBe ( 'Unprocessable Entity ' ) ;
107- expect ( result . body . description ) . toBe ( 'GitHub API unavailable.' ) ;
104+ const result = await agent . get ( '/api/home/changelogs' ) . expect ( 200 ) ;
105+ expect ( result . body . type ) . toBe ( 'success ' ) ;
106+ expect ( result . body . message ) . toBe ( 'changelogs ' ) ;
107+ expect ( result . body . data ) . toEqual ( [ ] ) ;
108108 } ) ;
109109
110110 test ( 'should use Authorization header when a token is configured for releases' , async ( ) => {
0 commit comments