File tree Expand file tree Collapse file tree
packages/feedback/test/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -293,6 +293,20 @@ describe('sendFeedback', () => {
293293 ) . rejects . toMatch ( 'custom forbidden text' ) ;
294294 } ) ;
295295
296+ it ( 'falls back to default messages for codes not in errorMessages' , async ( ) => {
297+ mockSdk ( ) ;
298+ vi . spyOn ( getClient ( ) ! . getTransport ( ) ! , 'send' ) . mockImplementation ( ( ) => {
299+ return Promise . resolve ( { statusCode : 400 } ) ;
300+ } ) ;
301+
302+ // Only override ERROR_FORBIDDEN — a 400 should still use the default generic message.
303+ await expect (
304+ sendFeedback ( { message : 'mi' } , { errorMessages : { ERROR_FORBIDDEN : 'custom forbidden text' } } ) ,
305+ ) . rejects . toMatch (
306+ 'Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.' ,
307+ ) ;
308+ } ) ;
309+
296310 it ( 'handles 400 transport error' , async ( ) => {
297311 mockSdk ( ) ;
298312 vi . spyOn ( getClient ( ) ! . getTransport ( ) ! , 'send' ) . mockImplementation ( ( ) => {
You can’t perform that action at this time.
0 commit comments