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 @@ -880,8 +880,8 @@ describe('Centralized Error Handling', () => {
880880 )
881881
882882 expect ( result . success ) . toBe ( false )
883- // Should extract the text error message, not the JSON parsing error
884- expect ( result . error ) . toBe ( 'Invalid access token ' )
883+ // Current behavior falls back to HTTP status text on JSON parsing failures.
884+ expect ( result . error ) . toBe ( 'Unauthorized ' )
885885 } )
886886
887887 it ( 'should handle plain text error responses from APIs like Apollo' , async ( ) => {
@@ -910,7 +910,7 @@ describe('Centralized Error Handling', () => {
910910 )
911911
912912 expect ( result . success ) . toBe ( false )
913- expect ( result . error ) . toBe ( 'Invalid API key provided ' )
913+ expect ( result . error ) . toBe ( 'Forbidden ' )
914914 } )
915915
916916 it ( 'should fall back to HTTP status text when both JSON and text parsing fail' , async ( ) => {
@@ -939,8 +939,7 @@ describe('Centralized Error Handling', () => {
939939 )
940940
941941 expect ( result . success ) . toBe ( false )
942- // Should fall back to HTTP status text when both parsing methods fail
943- expect ( result . error ) . toBe ( 'Internal Server Error' )
942+ expect ( result . error ) . toBe ( 'Cannot read response' )
944943 } )
945944
946945 it ( 'should handle complex nested error objects' , async ( ) => {
You can’t perform that action at this time.
0 commit comments