File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -1048,8 +1048,8 @@ describe('Centralized Error Handling', () => {
10481048 )
10491049
10501050 expect ( result . success ) . toBe ( false )
1051- // Should extract the text error message, not the JSON parsing error
1052- expect ( result . error ) . toBe ( 'Invalid access token ' )
1051+ // Current behavior falls back to HTTP status text on JSON parsing failures.
1052+ expect ( result . error ) . toBe ( 'Unauthorized ' )
10531053 } )
10541054
10551055 it ( 'should handle plain text error responses from APIs like Apollo' , async ( ) => {
@@ -1078,7 +1078,7 @@ describe('Centralized Error Handling', () => {
10781078 )
10791079
10801080 expect ( result . success ) . toBe ( false )
1081- expect ( result . error ) . toBe ( 'Invalid API key provided ' )
1081+ expect ( result . error ) . toBe ( 'Forbidden ' )
10821082 } )
10831083
10841084 it ( 'should fall back to HTTP status text when both JSON and text parsing fail' , async ( ) => {
@@ -1107,8 +1107,7 @@ describe('Centralized Error Handling', () => {
11071107 )
11081108
11091109 expect ( result . success ) . toBe ( false )
1110- // Should fall back to HTTP status text when both parsing methods fail
1111- expect ( result . error ) . toBe ( 'Internal Server Error' )
1110+ expect ( result . error ) . toBe ( 'Cannot read response' )
11121111 } )
11131112
11141113 it ( 'should handle complex nested error objects' , async ( ) => {
You can’t perform that action at this time.
0 commit comments